Skip to content

Instantly share code, notes, and snippets.

@jag1989
Last active July 7, 2017 13:04
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 jag1989/3613b74bbf69caa93aea845010fd5903 to your computer and use it in GitHub Desktop.
Save jag1989/3613b74bbf69caa93aea845010fd5903 to your computer and use it in GitHub Desktop.
WordPress Shortcode Search
select post.ID, meta.meta_value, post.post_content
from wp_postmeta as meta
inner join wp_posts as post
on meta.post_id = post.ID
where post.post_content
like '%[shortcode_name%'
or meta.meta_value
like '%[shortcode_name%'
and post.post_type != 'revision'
group by post.id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment