Skip to content

Instantly share code, notes, and snippets.

@tacensi
Created May 21, 2019 19:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tacensi/8bbc1d1d08d63616a2f1b839713b1fca to your computer and use it in GitHub Desktop.
Save tacensi/8bbc1d1d08d63616a2f1b839713b1fca to your computer and use it in GitHub Desktop.
Remove script tags from wp_content
UPDATE wp_posts
SET post_content = CONCAT(
SUBSTRING(
post_content, 1, INSTR(post_content, '<script') - 1
),
SUBSTRING(
post_content, INSTR(post_content, '</script>') + 9
)
)
WHERE post_content LIKE '%<script%'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment