Skip to content

Instantly share code, notes, and snippets.

@robertuniqid
Last active October 25, 2018 22:09
Show Gist options
  • Save robertuniqid/1d368d14d20e810d77df32a097152c1d to your computer and use it in GitHub Desktop.
Save robertuniqid/1d368d14d20e810d77df32a097152c1d to your computer and use it in GitHub Desktop.
I would love to be able to take the first 8(?) words of the body and copy them over to the Title
UPDATE `wp_posts` SET `post_title` = SUBSTRING_INDEX(PREG_REPLACE('#<[^>]+>#',' ',`post_content`), ' ', 8)
WHERE DATE(`post_date`) > '2000-11-11' AND DATE(`post_date`) < '2007-11-11'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment