The steps below show how to do a find and replace on the WordPress posts table using phpMyAdmin.
REMEMBER: backup your database before making any changes. You can do this by exporting the table or using the backup utilities in the cPanel.
- Log into the cPanel for your website. The address is usually www.website.com/cpanel, and the username and password would have been provided by your host when you first joined.
- Under ‘Databases’, click on the icon for ‘phpMyAdmin’
- Expand the database for the WordPress installation and click on the ‘wp_posts’ table
- Click on the ‘Inline’ link, then in the text box enter the following command
- Replace ‘old string’ and ‘new string’ with the find and replace you want to perform
UPDATE wp_posts SET post_content = REPLACE(post_content, 'old string','new string')
- Click ‘Go’ to apply the changes