1. Home »
  2. Tech

WordPress Search And Replace All Posts


When managing a large WordPress website with a huge number of posts it will not be easy to change data inside each post. This would be a challenge especially if you want to change for example image links in all posts or replacing a certain tag in all your posts.

How To Search And Replace All WordPress Posts

  1. Go to your phpMyAdmin provided by your hosting provider phpMyAdmin cPanel
  2. Choose your desired WordPress database that you want to search and replace all its posts from the list WordPress database
  3. This will redirect you to all WordPress tables inside your database, choose the wp_posts table. WordPress posts table
  4. Press on the SQL tab from the top. WordPress phpMyAdmin SQL query
  5. Use the following SQL query to search and replace all your WordPress posts. Search and Replace all WordPress posts
UPDATE wp_posts SET post_content=(REPLACE (post_content, 'old','new'));

Don’t forget to change the word old with the data you want search. Also change the word new with the data you want to insert in your posts.