Skip to content

Instantly share code, notes, and snippets.

@avenirer
Created August 26, 2019 09:48
Show Gist options
  • Save avenirer/37cc38388ab47f4113ad94a6d6492345 to your computer and use it in GitHub Desktop.
Save avenirer/37cc38388ab47f4113ad94a6d6492345 to your computer and use it in GitHub Desktop.
Wordpress mysql - remove whitespaces from post_excerpt and post_content
UPDATE wp_posts SET post_excerpt = REPLACE(post_excerpt, ' ', '');
UPDATE wp_posts SET post_excerpt = REPLACE(post_excerpt, '\t', '' );
UPDATE wp_posts SET post_excerpt = REPLACE(post_excerpt, '\n', '');
UPDATE wp_posts SET post_content = TRIM(Replace(Replace(post_content,'\t',''));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment