Skip to content

Instantly share code, notes, and snippets.

@gpspake
Created September 21, 2017 19:46
Show Gist options
  • Save gpspake/b500a8eb103251f90953db0322d7c7da to your computer and use it in GitHub Desktop.
Save gpspake/b500a8eb103251f90953db0322d7c7da to your computer and use it in GitHub Desktop.
Delete Script tags from WordPress Posts
#http://www.makeuseof.com/tag/edit-thousands-wordpress-posts-sql-command/
UPDATE wp_posts
SET post_content = REPLACE(
post_content,
substr(
post_content,
locate('<script type=', post_content),
(
(locate('<script type=', post_content) + 82) - locate('<script type=', post_content)
)
),
''
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment