WordPress – Find text within all posts

wordpress blue and white and grey logo

We recently started to update all of our old posts that contained our old domain name of techygeekshome.co.uk.

To do this, we needed to find all of the posts that actually have this in both the post content itself and also any links or code within the source of the post.

This could have been a painstaking process but we used a method of getting the information we required from our WordPress database using phpMyAdmin and a simple SQL query.


If you want to get a list of posts that has a set of text within it, then you can follow our simple guide.

Please note: You should always backup your database before doing anything – you mess it up, do not blame us!

You should first of all login to your cPanel and then get into your phpMyAdmin portal. From here you need to click into your database for your WordPress installation of the left hand side.

Once you are in the correct database, click on the SQL tab:

phpMyAdmin SQL Tab
Click to enlarge

Then in the query box below it, you should type in this query:

SELECT * FROM wp_posts WHERE post_content LIKE '%techygeekshome.co.uk%'


  • wp_posts = the name of your posts table
  • ‘%techygeekshome.co.uk%’ = the text that you want to find in the WordPress database

You should then press the Go button at the bottom right:

phpMyAdmin Query Box
Click to enlarge

This will then go off and find all the posts with the stated text in it:

phpMyAdmin Results Posts
Click to enlarge

Now you have pulled the data from the SQL database, you now can export that data to CSV format so that you can open it in Excel.

Just tick the Show all tick box:

phpMyAdmin show all rows
Click to enlarge

If you get a popup warning you about it pulling a lot of data, just click on the OK button:

phpMyAdmin Pop Up Box
Click to enlarge

Then scroll to the bottom of the page and you will see the Export option:

phpMyAdmin Export Option
Click to enlarge

This will then take you to the exporting page options, from the drop down menu you can select CSV and click the Go button:

phpMyAdmin Export Options
Click to enlarge

This will then export the data in to a CSV file which you can now go ahead and open in Excel.


If you have any questions or comments on this guide, please feel free to leave us a message below in our comments section.

Free Subscription!Subscribe to our site to receive updates via email!

Enter your email address below and click the Subscribe button to receive email notifications about new and exciting downloads available through our website at https://www.techygeekshome.com

You will also receive notifications about new technical guides, latest news and MSI installer downloads that are available through our blog here at https://blog.techygeekshome.info 

We will not spam you and we will not pass on any of your details to anyone else. We tend to post new content once or twice a week.

Join 275 other subscribers

You can unsubscribe any time you like.

About A.J. Armstrong

Founder of TechyGeeksHome and Head Editor for over eight years! IT expert in multiple areas for over 20 years. Sharing experience and knowledge whenever possible! Making IT Happen.

View all posts by A.J. Armstrong