WordPress : hide shortcodes in TinyMCE

Is it possible to change shortcode appearance in WordPress TinyMCE editor? One of my clients has no HTML knowledge and it’s really hard to explain him what not to edit on subpages.

All I want is to hide the shortcodes and add a button on the kitchen sink to show them.

Read More

Work arounds.
1 – Filter content before displaying in the editor. Onclick of the button in kitchen sink, call the same url with a $_GET param e.g ?filter=false and do not filter the content this time.

2 – Wrap all shortcodes in a div with a specific class before displaying and toggle that class onclick of the button in the kitchen sink.

For both ways I need to get the content before displaying it in TinyMCE so that I can modify it. Unable to do so .. please help.

P.S: this needs to be done in a plugin. cannot modify core wordpress files.

Related posts

Leave a Reply

1 comment

  1. You could use the tinymce param “setup” and create a onBeforeSetContent handler.
    This way you can modify the content before it gegts into the editor and perform Action 2.