Home >CMS Tutorial >WordPress >Clear WordPress article summary content in batches

Clear WordPress article summary content in batches

藏色散人
藏色散人forward
2019-11-05 11:48:413536browse

The following column WordPress Tutorial will introduce to you how to batch clear the summary content of WordPress articles. I hope it will be helpful to friends in need!

Clear WordPress article summary content in batches

Sometimes when converting data from other website programs to WordPress, spaces will automatically appear in the "summary" of the article, or you don't want these summary contents at all after switching to WP. We can pass Execute SQL statements to clear summary contents in batches.

Add the following code to the current theme functions.php:

global $wpdb;
$wpdb->query( "
UPDATE wp_posts SET post_excerpt = ''
" );

After that, refresh the website page and the summary content will be cleared from the database. It is enough to run this code once, there is no need to keep it in the theme, just delete it after use.

Tips: Please back up your data in advance before operation, just in case!

The above is the detailed content of Clear WordPress article summary content in batches. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:zmingcx.com. If there is any infringement, please contact admin@php.cn delete