preload
Apr 17

因為從 flickr [blog this] 過來的文章都會有 <br clear=”all” /> 在這裡會讓 WordPress 的版面怪怪的,所以要把他從資料庫裡直接清掉,不然一篇一篇改超累。

搜尋置換字串 SQL 指令格式:
update [資料表] set [資料欄位]= replace([資料欄位], '[舊字串]', '[新字串]');

實做過程:
mysql -u root -p
mysql> use wordpress;
mysql> show tables;
mysql> SHOW COLUMNS FROM wp_posts;
mysql> update wp_posts set post_content= replace(post_content, '<br clear="all" />', '<br>');
Query OK, 93 rows affected (0.07 sec)
Rows matched: 551 Changed: 93 Warnings: 0

mysql> quit

搞定收工!

溫故知新

載入中…

歷史上的今天..

相關文章:

Tagged with:

Leave a Reply