List all pages containing shortcode (WordPress)
-
I am writing a plugin for wordpress that creates shortcodes. On this plugins settings page, I would like to have it list out what pages the shortcode is being used on. (For ease of access and locating them for quick changes.)
I figured it would be something with get_post(), where it searched all the posts that matched a filter, then listed them, but I can’t seem to figure out what the syntax for that would be, or if this is even possible.
Any suggestions?
Edit: A user on stackoverflow suggested I run a query in the database using the following query; SELECT * FROM wp_posts WHERE post_content LIKE ‘%[mod-%’ AND post_status = ‘publish’ LIMIT 0,1000 however i’m not sure that will work in my case.
The topic ‘List all pages containing shortcode (WordPress)’ is closed to new replies.