I've noticed that there are times then a WordPress website owner needs to replace text elements in all his posts. One user had been using alt tags in his links and wanted to replace then with the correct title tag. Another use had been using short code for a particular plugin for yeas and then changed to another plugin and needed to change all the outdated short code on his site. In this tutorial I'm going to show you how to replace a word or a text string with another word in all your WordPress posts at once using cPanel.
Search and replace in WordPress using cPanel & phpMyAdmin
- Log into your cPanel account.Note: If you're a 2slick.com customer, you can access your cPanel by navigating your browser to mywebsite.com/cpanel.
- Click on the 'phpMyAdmin' icon.
- You will see a list of databases on the left side on the screen. Your WordPress website database will be in the list. Click on your WordPress website database.
- Before we start replacing words in your WordPress website, let's back up the table we'll be modifying.
- Click on you 'posts' table. Your posts table will appear with an abbreviation as part of it for exampe 'wp_posts', 'wordpress_posts', etc.
- Click the 'Export' tab.
- Click the 'Go' button. Let the backup file download and make a note where it is. If you screw up your 'wp_posts' table, we'll need the backup file to fix it.
- Click on the 'Query window' icon .
- In the query window that pops up insert this command.
MySQL | copy code | ? Note: This command will replace all the instances of the word 'duck' with the word 'chicken' in all your posts throughout your WordPress site. Replace the words 'duck' and 'chicken' with the words you want to replace on your site.1 update wp_posts set post_content = replace(post_content,'duck','chicken')
- Click the 'Go' button that's on your query popup window.
That's it... if everything went well, the text should be replaced on all your posts.