Home » , , » How To Find and Replace DataBase WordPress using phpMyAdmin

How To Find and Replace DataBase WordPress using phpMyAdmin


You can do a find and replace for text or html code on a post or page across a whole WordPress site by using the mysql database that the site stores all its data in.

First up you need to connect to the database, if you have a cPanel/Plesk style hosting typically you will have an option to connect to the database via phpmyadmin.

Connect to your WebHost 


Connect to your WebHost

 Select your WordPress database 


If you have multiple databases and don’t know which one, check the database name in the wp-config.php file which is stored in your webroot; htdocs or public_html.

Select the wp_posts table 

Select the wp_posts table

To Search For a Text Query Only 

Select SQL Tab and add in the Search Query SQL



SELECT * FROM wp_posts WHERE (post_content LIKE '%TEXT-TO-FIND-GOES-HERE%');

Click ‘Go’



To edit the post, click on edit and do what needs to be done – if you edit the text it will be updated in your WordPress post.

To Search and Replace For a Text String

Select SQL Tab and add in the Search and Replace SQL Code




So here switch to the ‘SQL’ tab add in the code below and click on the ‘Go’ button.

UPDATE wp_posts SET post_content = REPLACE (  post_content,  'text to find here',  'text to replace here');

So with the SQL code you put your text between the single quotes for what you are finding and what you are replacing these are separated by the comma.

See the Results 



Doing it via Command Line 

This can also be easily done via the command line, you just need to start a mysql session:

mysql -u username -ppassword


use mywordpress_table;



UPDATE wp_posts SET post_content = REPLACE (  post_content,  'text to find here',  'text to replace here'); 


Judul : How To Find and Replace DataBase WordPress using phpMyAdmin
Peringkat : 7 / 10 . 264 voting. 197 pengguna.
URL : http://seotipsku.blogspot.com/2014/01/how-to-find-and-replace-text-across.html
Ditulis Oleh : EraVisi

4 komentar :

  1. Nice way to remove problems in multiple posts. Would rather use the built-in editor for just a single post. Two thumbs up!

    BalasHapus
  2. https://khojdo.com/how-to-uninstall-webroot-secureanywhere-or-endpoint-protection-on-windows-78-or-10-step-by-step-tutorial/

    BalasHapus
  3. Great post! I love this article. Keep it up!

    BalasHapus

Terima kasih sudah berkunjung ke Blog ini, Silahkan anda meninggalkan komentar, komentar anda akan segera dimoderasi...