Tuesday, July 23, 2013

How to search a wordpress database for shortcodes

MySQL can regex sweetness!

here is how to search wordpress posts for shortcodes today we are searching for the shortcode

[auction startbid:250] or [auction startbid:100] etc so we can use regex to find all the shortcodes with various amounts.

select * from wp_posts where
post_content   REGEXP  '\[auction startbid:[0-9]+\]'


Stumble Upon CodePyro

3 comments:

Alia parker said...
This comment has been removed by the author.
Alia parker said...

This is my first visit to your internet journal! We are a team of volunteers as well as new tasks in the same specialized. Site provided us helpful data to work. Typeform alternative

deniz said...

kuşadası
milas
çeşme
bağcılar
tekirdağ

BP7M

Post a Comment