Zhao Wei disappeared from the Internet overnight, so how can the text in WordPress articles disappear and be replaced in batches?

888u

Last update at :2024-01-22,Edit by888u

We all know that Zhao Wei disappeared from the Internet overnight a few days ago, and all related works were removed. Many information about "Zhao Wei" cannot be found. This is definitely not deleted one by one, it needs to be done in batches. Operation, similarly, as a WordPress blog webmaster, if we need to delete some fields in the website one day, we will definitely need to use batch operations to replace the text in the WordPress article.

If you plan to replace and modify the same text scattered in a large number of WordPress articles, and manually editing the articles and modifying them requires a lot of work, you can use the following code to implement batch replacement. The WordPress operating data constant $wpdb will be used to modify the database, and no login is required. Database operations.

Add the code to the end of the current theme function template functions.php:

global $wpdb; $wpdb->query("UPDATE wp_posts SET post_content = replace( post_content, 'old text', 'new text' )");

To modify the text, if there are multiple paragraphs of text, just copy a few more pieces of code, add them to functions.php, and delete them after use.

It also supports replacing links in articles.

Tips: Operating the database is risky, please make a backup in advance!

Recommended site searches: local IP address query, what does server hosting mean, Taiwan server, foreign space rental, Chinese domain name registration, Hong Kong server rental 99idc, Qingdao ip agent, Hong Kong server, Hong Kong server rental, domain name registration with the Ministry of Industry and Information Technology,

Zhao Wei disappeared from the Internet overnight, so how can the text in WordPress articles disappear and be replaced in batches?

All copyrights belong to 888u unless special state
取消
微信二维码
微信二维码
支付宝二维码