Title: Blocking a Shortcode
Last modified: November 4, 2022

---

# Blocking a Shortcode

 *  [rexsorgatz](https://wordpress.org/support/users/rexsorgatz/)
 * (@rexsorgatz)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/blocking-a-shortcode/)
 * Hi there, love the plugin, it works great. In my case, too great. Here is my 
   situation….
 * My site has a number of shortcodes embedded in the body that I don’t want to 
   appear on Apple News. I’ve got a rough idea of the syntax I need, something like
   this…
 *     ```
       add_filter( 'apple_news_exporter_content_pre', 'disable_myshortcode' );
       function disable_myshortcode($content, $postID) {
       	remove_shortcode('myshortcode');
       }
       ```
   
 * But that’s not working. Is that the right filter? Is there a different way the
   remove_shortcode should be invoked? Any thoughts?
 * Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [rexsorgatz](https://wordpress.org/support/users/rexsorgatz/)
 * (@rexsorgatz)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/blocking-a-shortcode/#post-16183063)
 * Hi, surfacing this for [@kevinfodness](https://wordpress.org/support/users/kevinfodness/),
   in case you missed it, as it was submitted over the weekend. (Does tagging people
   in here do anything? I guess we’re about to find out.)
 *  Thread Starter [rexsorgatz](https://wordpress.org/support/users/rexsorgatz/)
 * (@rexsorgatz)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/blocking-a-shortcode/#post-16363365)
 * For anyone else who stumbles across this, this is what eventually worked:
 * `add_action( 'apple_news_exporter_content_pre', 'disable_myshortcodes');
   function
   disable_myshortcodes($content) {$content = strip_shortcodes($content);return 
   $content;}
 * It removes all shortcodes, not a specific one, but that was fine for my scenario.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Blocking a Shortcode’ is closed to new replies.

 * ![](https://ps.w.org/publish-to-apple-news/assets/icon-256x256.png?rev=3017580)
 * [Publish To Apple News](https://wordpress.org/plugins/publish-to-apple-news/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/publish-to-apple-news/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/publish-to-apple-news/)
 * [Active Topics](https://wordpress.org/support/plugin/publish-to-apple-news/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/publish-to-apple-news/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/publish-to-apple-news/reviews/)

 * 2 replies
 * 1 participant
 * Last reply from: [rexsorgatz](https://wordpress.org/support/users/rexsorgatz/)
 * Last activity: [3 years, 4 months ago](https://wordpress.org/support/topic/blocking-a-shortcode/#post-16363365)
 * Status: not resolved