Skip to content

Instantly share code, notes, and snippets.

@jasperf
Last active December 18, 2015 17:39
Show Gist options
  • Save jasperf/5819653 to your computer and use it in GitHub Desktop.
Save jasperf/5819653 to your computer and use it in GitHub Desktop.
Replace WordPress content in posts when the post is not empty using a MySQL query. This I sometimes use to replace dummy content with Lorem Ipsum content to make it easier for clients to focus on the layout and style and not so much on the text, #wordpress #posts
//NB Replace wp with your own prefix
//see http://stackoverflow.com/questions/17099905/replace-old-wordpress-post-content-with-new-if-not-empty
//For Lorem Ipsum Content see http://www.blindtextgenerator.com/lorem-ipsum
UPDATE wp_posts SET post_content = 'NewText' WHERE post_content > ''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment