With the WordPress plugin Search & Replace you can search for and replace any content such as the domain of your website or text fragments in the WordPress database. In this post I present the possibilities and uses of the plugin in detail.
Search & Replace
The Search & Replace plugin - or in the German translation Search & Replace - is developed by the well-known German WordPress agency Inpsyde and can be downloaded from WordPress.org.
Search & replace data in your database in the WordPress admin. Replaced domain / URLs from your WordPress installation.
After installing the plugin, the tool can be found under Tools → Search & Replace in the WordPress admin area.
Don't forget to backup the database
Before applying the plugin a backup of the database should be carried out in any case in order to be protected against data loss and corrupt tables. The plugin offers a very simple solution for backing up and restoring the database.
Find and replace text in the WordPress database
The main function of the plugin is available in the Search & Replace tab. Here you can search for any word, entire sentence, URL or HTML code and replace it with a new character string. The search can be carried out for the entire WordPress database or restricted to certain tables.
The test run option is very helpful. This allows the search function to be tested without actually making changes to the database.
By clicking on Show details , the potential changes are displayed with the old and new values for the respective tables and table fields.
By deactivating the checkbox for the test run, the search and replace can be applied to the database, the changes are then written to all selected tables. Alternatively, an SQL file with the changes can be exported.
Moving the website with migration to another domain
The plug-in provides an additional option for migrating the domain. The function is particularly useful if you want to move your website to another domain and migrate the database for this purpose. The prefix of the tables can also be changed.
After searching and replacing the domain, the database can be downloaded as an SQL file and then imported to the new website.
In the function Replace Domain URL , the change cannot be made directly in the WordPress database. The tab is therefore useful for moving the website, but not very helpful if, for example, all URLs are to be switched from http to https.
The normal Search & Replace function of the plugin is better suited for this.
The alternative: Better Search Replace
A popular alternative is Better Search Replace from Delicious Brains.
A simple plug-in for "finding" and "replacing" URLs and other strings in your WordPress database
The plugin has a smaller range of functions and is limited to searching and replacing in the WordPress database. Exporting and importing the database as an SQL file is only possible with the Pro version.
Both plugins fulfill their core task with flying colors and support important features like selection of tables, test run, WordPress MultiSite support and the search and replacement of serialized arrays and objects. Better Search Replace is a bit leaner, but my favorite Search & Replace offers more functions and is completely free.