# How to use do_shortcode_tag to modify the output of a shortcode?

I would like to add shortcodes whose content gets processed by plugins before it gets displayed in the page.

In particular, I have a plugin which processes content between two $signs to produce math formulas and graphs. A simple shortcode is add_shortcode( 'test', 'test_sc' ); function test_sc($atts ){ return "$\frac{15}{5} = 3$"; }


By writing $\frac{15}{5} = 3$ in a page this gets displayed

By writing [test] in a page this gets displayed $\frac{15}{5} = 3$

WordPress does a few things before the content from a page or post gets displayed on the site. For instance, it processes HTML paragraph (p) tags, it runs shortcodes and even sends the content to the theme and any plugins so they can do their thing to the content and include their bits.

I heard that using do_shortcode_tag (reference) it is possibile to do full content processing, but how to do that?

return apply_filters( 'the_content', '$\frac{15}{5} = 3$' );
• 1) You need to always end all statements with a ; even if I forgot it in my comment. 2) Not other files, but actions determine when something should happen: add_action( 'wp_loaded', function() { remove_all_filters( 'the_content' ); } ); – Knut Sparhell Sep 29 '19 at 22:52