I’ve taken over and built a new theme utilizing all the goodies WordPress comes with. I’m also using the built-in excerpts functions within WordPress… however, the previous user wasn’t using automatic excerpts and was manually typing their own excerpts.
I was wondering if there is a method to either override the manual excerpts or to perform a bulk edit on the excerpts?
Use the query
in phpmyadmin. Change the table prefix in the query if the default prefix of
wp_
isn’t being used. Backup your database first.Or:
If you don’t want to use phpmyadmin, run the MySQL query as a
$wpdb
PHP function.Put this at the bottom (or top) of your functions.php file and reload the site:
Or put this in a template file, like index.php, and reload the page:
And of course, remove either of those PHP functions from the file after you run them.
Edit: and, it’s a good idea to select for the post type of posts when using the query, as Murilo Pontes in his answer; otherwise, plugins and other functions that may use the excerpt for data storage will lose their data.
Don’t use “UPDATE wp_posts SET post_excerpt=” “. That can break things (like email templates) if post_type is not configured
Use the following querys instead.
View excerpts
SELECT
post_excerpt
FROMwp_posts
WHEREpost_type
=’post’Update excerpts to ”
UPDATE wp_posts SET post_excerpt=” WHERE
post_type
=’post’