Skip to content

Instantly share code, notes, and snippets.

@jamesmthornton
Created June 25, 2020 20:37
Show Gist options
  • Save jamesmthornton/518d1edc66e64a5e59d16cd4f44bf99c to your computer and use it in GitHub Desktop.
Save jamesmthornton/518d1edc66e64a5e59d16cd4f44bf99c to your computer and use it in GitHub Desktop.
Remove a prepended constant from post titles in Wordpress
-- this would remove the following string including a trailing space: [PMC Daily Insight]
UPDATE wp_posts
SET post_title =
MID( post_title, LENGTH('[PMC Daily Insight] ')+1 )
WHERE post_title LIKE '[PMC Daily Insight] %'
AND post_type = 'post';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment