I'm creating a plugin specialized for a website. Most of the pages are pretty general (blog posts, contact pages, etc...) but a handful of pages will have custom code (specific SQL) for display statistics.

I'm wondering, best practices and what-not, is is better to build the page with all of the code inside of a function and then replace the_content using the filter...OR...should I build the html inside of the page (using the basic WP admin pages) and do a replace at certain spots for variable values?

Does this make sense?


1 Answer 1


Use shortcodes for that, that is exactly what they are for.

  • I'm such an idiot. I've created shortcodes and placed them inside of my content and then replaced the content in the filter. sigh
    – jay1_z
    Feb 23, 2015 at 18:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.