Better Search Replace

Description

When moving your WordPress site to a new domain or server, you will likely run into a need to run a search/replace on the database for everything to work correctly. Fortunately, there are several plugins available for this task, however, all have a different approach to a few key features. This plugin consolidates the best features from these plugins, incorporating the following features in one simple plugin:

  • Prise en charge de la sérialisation pour toutes les tables
  • La possibilité de sélectionner des tables spécifiques
  • La possibilité de faire un « essai à blanc » pour voir combien de champs seront mis à jour
  • Aucune exigence de serveur en dehors d’une installation WordPress fonctionnelle
  • Prise en charge de WordPress Multisite

Time-saving features available in the Pro version:

  • View exactly what changed during a search/replace
  • Backup and import the database while running a search/replace
  • Priority email support from the developer of the plugin
  • Save or load custom profiles for quickly repeating a search/replace in the future
  • Support et mises à jour pour un an

En savoir plus sur Better Search Replace

The search and replace functionality is heavily based on interconnect/it’s great and open-source Search Replace DB script, modified to use WordPress native database functions to ensure compatibility.

Langues prises en charge

  • Anglais
  • Français
  • Allemand
  • Espagnol

Envie de contribuer ?

Feel free to open an issue or submit a pull request on GitHub.

Captures d’écran

  • La page Better Search Replace a été ajoutée au menu « Outils »
  • Après avoir effectué une recherche / remplacement à blanc.

Installation

Installez Better Search Replace comme n’importe quelle autre extension WordPress.

Dashboard Method:

  1. Connectez-vous à votre administration WordPress et allez à Extensions > Ajouter
  2. Saisissez « Better Search Replace » dans la barre de recherche puis sélectionnez cette extension
  3. Cliquer sur « Installer », puis « Activer l’extension »

Upload Method:

  1. Décompresser l’extension et téléversez le dossier « Better-search-replace » sur votre serveur dans le répertoire « wp-content/plugin »
  2. Activez l’extension via le menu « Extensions » dans WordPress

FAQ

Utilisation de Better Search Replace

Once activated, Better Search Replace will add a page under the « Tools » menu page in your WordPress admin.

Mon hébergeur est-il pris en charge ?

Oui ! Cette extension devrait être compatible avec n’importe quel hébergeur.

Puis-je endommager mon site avec cette extension ?

Yes! Entering a wrong search or replace string could damage your database. Because of this, it is always adviseable to have a backup of your database before using this plugin.

Comment cela fonctionne-t-il sur un site WordPress multisite ?

When running this plugin on a WordPress Multisite installation, it will only be loaded and visible for Network admins. Network admins can go to the dashboard of any subsite to run a search/replace on just the tables for that subsite, or go to the dashboard of the main/base site to run a search/replace on all tables.

How can I use this plugin when changing URLs?

If you’re moving your site from one server to another and changing the URL of your WordPress installation, the approach below allows you to do so easily without affecting the old site:

  1. Sauvegarder la base de données sur votre site actuel
  2. Install the database on your new host
  3. On the new host, define the new site URL in the wp-config.php file, as shown here
  4. Log in at your new admin URL and run Better Search Replace on the old site URL for the new site URL
  5. Delete the site_url constant you added to wp-config.php. You may also need to regenerate your .htaccess by going to Settings -> Permalinks and saving the settings.

Plus d’informations sur la migration d’un site WordPress ici.

Avis

21 septembre 2024
This plug-in saves me the trouble of using SQL to search and replace in MySQL database. Free version worked well for my use case. A reminder that the best practice is backing up the database before using anything like this.
17 septembre 2024
Here is the thing. I had changed my blog’s domain name and had issues with the images still on the old domain name. So, they were not loading. At all. So, I went to ask uncle ChatGPT how to solve the issue. He told me I should try this plugin, and he was even generous enough to give me the instructions. In less than a minute, my issue was resolved. 5 stars from me. Thanks.
26 août 2024
I have been using this plugin for years but apparently forgot to write a review, while I’m always happy using it. It’s a very handy tool to replace a bunch or url’s
7 août 2024
Does nothing on my installation, no error no success message, no update on database, juste reload the page when you it the button
13 juillet 2024 1 réponse
Seriously?! This really got me some headaches. You don’t seem to test your tool properly. Dry run is the default option, I love it! But also checking the box above (replace GUIDs) overrules this dry run option silently! It’s still checked, but the tool will change your actual database! Unacceptable.
Lire les 526 avis

Contributeurs/contributrices & développeurs/développeuses

« Better Search Replace » est un logiciel libre. Les personnes suivantes ont contribué à cette extension.

Contributeurs

“Better Search Replace” a été traduit dans 29 locales. Remerciez l’équipe de traduction pour ses contributions.

Traduisez « Better Search Replace » dans votre langue.

Le développement vous intéresse ?

Parcourir le code, consulter le SVN dépôt, ou s’inscrire au journal de développement par RSS.

Journal

1.4.7 – May 30, 2024

  • Fix: The case-insensitive setting once again allows case-insensitive strings to be matched within serialized data, fixing a regression introduced in version 1.4.6

1.4.6 – April 17, 2024

  • Changed: Serialized text strings are now only deserialized when containing a match, resulting in faster performance
  • Security: Table names are now escaped when displaying search results

1.4.5 – January 18, 2024

  • Security: Unserializing an object during search and replace operations now passes 'allowed_classes' => false to avoid instantiating the object and potentially running malicious code stored in the database (thanks to Wordfence for responsible disclosure on December 18, 2023 followed by development and testing of the fix by WP Engine)
  • Fix: A regression in version 1.4.4 which caused some search results to be skipped has been fixed to ensure only numeric keyed objects are skipped

1.4.4 – December 14, 2023

  • Fix: Objects with numerical properties are now skipped to avoid causing errors

1.4.3 – September 5, 2023

  • New: Links to plugin documentation, support, feedback, and changelog are now available in the footer of WP Admin
  • Improvement: PHP 8.2 and Better Search Replace are now compatible

1.4.2 – January 11, 2023

  • Security: Arbitrary tab templates in the templates directory can no longer be loaded using a query parameter.

1.4.1 – July 25, 2022

  • Security: Selected tables are now confirmed to exist before processing the request

1.4 – April 7, 2022

  • New: Better Search Replace has a brand new user interface
  • Improvement: Default capability required to use the plugin has changed from « install_plugins » to « manage_options » for compatibility with DISALLOW_FILE_MODS

1.3.4 – December 7, 2020

  • Improvement: WordPress 5.6 and PHP 8 compatible
  • Fix: Strings that have been serialized twice showing up as false-positives

1.3.3 – February 26, 2019

  • Fix: Some special characters interfering with search/replace
  • Security: Pass template filenames through sanitize_file_name()
  • Security: Verify nonce when downloading diagnostic info

1.3.2 – January 3, 2018

  • Fix: Only one table searched on some environments (props @Ov3rfly)
  • Tweak: Update text in sidebar

1.3.1 – September 14, 2017

  • Security: Check if data is serialized before unserializing it
  • Improvement: Increased size of table select

1.3 – November 10, 2016

  • Improvement: Updated sidebar and added pro version discount
  • Fix: Outdated links to old website
  • Fix: Prevent requests to invalid tabs

1.2.10 – June 2, 2016

  • Fix: CSS not loaded on details page

1.2.9 – December 8, 2015

  • Fix: Bug with case-insensitive searches in serialized objects
  • Fix: Bug with early skip due to lack of primary key

1.2.8 – November 25, 2015

  • Fix: Bug with report details

1.2.7 – November 24, 2015

  • Fix: Untranslateable string
  • Tweak: Check BSR_PATH instead of ABSPATH to be consistent
  • Tested with 4.4

1.2.6

  • Removed unused code/small cleanup

1.2.5

  • Improved progress bar info and styles
  • Small cleanup

1.2.4

  • Added « Settings saved » notice when saving settings
  • Fixed bug with wp_magic_quotes interfering with some search strings

1.2.3

  • Fixed bug with searching for backslashes
  • Fixed potential bug with getting tables in large multisites
  • Fixed potential notice in append_report
  • Improved handling of missing primary keys

1.2.2

  • Fixed AJAX conflict with WooCommerce
  • Fixed a few issues with translations
  • Tweaked « System Info » to use get_locale() instead of WP_LANG constant
  • Updated German translation (props @Linus Ziegenhagen)

1.2.1

  • Fixed minor issue with display of progress bar
  • Updated translation file

1.2

  • Switched to AJAX bulk processing for search/replaces
  • Decreased minimum « Max Page Size » to 1000
  • Added « Help » tab with system info for easier troubleshooting

1.1.1

  • Ajouté la possibilité de modifier la taille maximale de la page
  • Diminution de la taille de la page par défaut afin d’éviter le problème de l’écran blanc sur certains environnements

1.1

  • Added ability to change capability required to use plugin
  • Correctif de petits bugs et traduction

1.0.6

  • Ajouté les tailles de table à la liste de la base de données
  • Ajouté la traduction française (proposée par @Jean Philippe)

1.0.5

  • Added support for case-insensitive searches
  • Traduction allemande ajoutée (props @Linus Ziegenhagen)

1.0.4

  • Correctif de potentiels problèmes de sécurité

1.0.3

  • Correctif du problème avec la recherche des caractères spéciaux comme « / »
  • Fixed bug with replacing some objects

1.0.2

  • Fixed untranslateable strings on submit button and submenu page.

1.0.1

  • Fixed issue with loading translations and added Spanish translation (props Eduardo Larequi)
  • Fixed bug with reporting timing
  • Mise à jour pour avoir la fonctionnalité « Faire un essai » par défaut
  • Added support for WordPress Multisite (see FAQs for more info)

1.0

  • Initial release