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

Clear WordPress article summary content in batches

藏色散人
Release: 2019-11-05 11:48:41
forward
3537 people have browsed it

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 = ''
" );
Copy after login

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!

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template