I saw unknown symbols, such as � show up in blog posts.
There is a way to fix it. The method is search and replace contents in WordPress via phpMyAdmin or MySQL Console
1. Backup the WordPress database.
MySQL console :
- mysqldump :
mysqldump -u [username] -p [databasename] > [mysqlfile_name]
example :
mysqldump -u try -p px > /tmp/kate/backupfile01.sql
output :
Enter password : [type your password]
phpMyAdmin :
- Choose Database
- Choose Export tab
- Options : Export SQL, Structure Add DROP TABLE / DROP VIEW, check Save as File and push Go button
2. Ssearch and replace content via phpMyAdmin. Console cannot recognized symbols, �
- Choose Database
- Choose table wp_posts (click wp_posts in left bar)
- Choose SQL tabs
- Type this inside Run SQL query/queries on database box :
UPDATE wp_posts SET post_content = REPLACE (post_content,'�',' ')
note : without delimiter ; - Push GO button. DONE!
SEARCH AND REPLACE VIA MYSQL CONSOLE ONLY WORK FOR ITEMS RECOGNIZED BY CONSOLE.
mySQL Console
- log in to mySQL Console
mysql -u [username] -p
Enter password : [type your password]
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is xxx to server version: x.x.x��Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.
mysql>
use [database_name]
mysql>(You want to make sure wp_posts table)show tables;
mysql>+----------------------------+
| Tables_in_wordpress |
+----------------------------+
| wp_comments |
| wp_falbum_cache |
| wp_links |
| wp_liveshoutbox |
| wp_liveshoutbox_useronline |
| wp_options |
| wp_podpress_statcounts |
| wp_podpress_stats |
| wp_postmeta |
| wp_posts |
| wp_term_relationships |
| wp_term_taxonomy |
| wp_terms |
| wp_usermeta |
| wp_useronline |
| wp_users |
+----------------------------+
16 rows in set (0.00 sec)
mysql >UPDATE wp_posts SET post_content = REPLACE (post_content,'Item to replace','Replacement text');
mysql >exit
Related posts:





0 Trackbacks
Trackback URL for this post:
http://pixert.com/search-replace-contents-wordpress-database-phpnyadmin-mysql-console/trackback/
0 Pings