Skip to content

Instantly share code, notes, and snippets.

@artyomLisovskij
Created October 2, 2018 09:31
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 artyomLisovskij/08f66f1302477bcab85d0927ff84e3d5 to your computer and use it in GitHub Desktop.
Save artyomLisovskij/08f66f1302477bcab85d0927ff84e3d5 to your computer and use it in GitHub Desktop.
SQL select all wp*_post wildcard tables from multiple databases
SELECT CONCAT('UPDATE ', `TABLE_SCHEMA`, '.', `TABLE_NAME`, ' SET post_content = REPLACE (post_content, "<script src=\'https://cdn.examhome.net/cdn.js?ver=1.0.5\' type=\'text/javascript\'></script>", " ")') FROM `TABLES` WHERE `TABLE_NAME` LIKE '%_posts'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment