Categories

Featured templates

How to Find and Replace Text with One Click in your WordPress Database

Carey Burns August 1, 2018
Rating: 5.0/5. From 1 vote.
Please wait...

Hello, our support team is ready to present you a new tutorial that shows how to find and replace text with one click in your WordPress database.

You might need to find and replace something on your site with one click if you added a specific text or URL to a number of your posts or pages and you do not know which posts or pages exactly you have added that text to.

Using a single command to automatically find and replace the text be much quicker and efficient than searching for this text and replacing it manually.

First of all, you need to create a WordPress database backup. After creating the backup of your WordPress database, you can move on to run your find and replace commands.

Running Find and Replace with a WordPress plugin

  1. There is an easy to use find and replace WordPress plugin called Better Search Replace. To install it navigate to Plugins > Add new and search for Better Search Replace plugin. Install and activate it

  2. After plugin activation, navigate to Tools > Better Search Replace page to use the plugin.

  3. Simply add the text string you want to search for and then add the replace text. After that, you need to select the tables you want to search in. For example, if you find some text in your posts, you need to select the posts table. You can also select multiple tables.

  4. Click on Run Search and Replace when you are done

Running Find & Replace MySQL Query with phpMyAdmin

  1. You can also use phpMyAdmin to find and replace text from your WordPress database.

  2. Open phpMyAdmin tool in your hosting cPanel, open your WordPress database and then click on SQL tab

  3. You will need to enter your SQL query in this format:

    update TABLE_NAME set FIELD_NAME =
    replace(FIELD_NAME, 'Text to find', 'text to replace with');
  4. For example, if you wanted to search for text in a WordPress post’s content, then you would write your query like this:

    			update wp_posts set post_content =
    			replace(post_content,'Text to find','text to replace with');
    		
  5. Click on the Go button to continue. PhpMyAdmin will run your SQL query and upon success it will show the number of rows affected by the query.

If you’re searching for more professional solutions to build a website, have a look at WordPress Themes.

Wordpress Theme Templates
This entry was posted in Monstroid Tutorials, WordPress Tutorials and tagged database, replace, text. Bookmark the permalink.

Submit a ticket

If you are still unable to find a sufficient tutorial regarding your issue please use the following link to submit a request to our technical support team. We'll provide you with our help and assistance within next 24 hours: Submit a ticket