Title: Disable shortcode but keep plugin active
Last modified: March 22, 2021

---

# Disable shortcode but keep plugin active

 *  Resolved [daricedotorg](https://wordpress.org/support/users/daricedotorg/)
 * (@daricedotorg)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/disable-shortcode-but-keep-plugin-active/)
 * I’d like to disable to shortcode while keeping the plugin active. We use it more
   in the admin to keep track of the credits. On the frontend, it does not work 
   flawlessly as it tends to limit the image in width.
 * I tried the code (found in the FAQ) in functions.php to disable the shortcode.
   But the shortcode still shows.
 * Is there a way to just have media credits active in the admin and not in the 
   posts?

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

 *  Plugin Author [pepe](https://wordpress.org/support/users/pputzer/)
 * (@pputzer)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/disable-shortcode-but-keep-plugin-active/#post-14219406)
 * Hi [@daricedotorg](https://wordpress.org/support/users/daricedotorg/),
 * the snippet in the FAQ only works when Media Credit is not activated on your 
   site (otherwise it does nothing, as you have discovered). If you only need to
   disable the shortcode output on the frontend, you can use [this filter](https://github.com/mundschenk-at/media-credit/blob/master/includes/media-credit/components/class-shortcodes.php#L258):
 * `add_filter( 'media_credit_shortcode', function( $credit, $atts, $content ) {
   return $content; }, 10, 3 );`
 * As for the image width issue, you can disable the width forced onto the image
   caption/credit by [returning zero from the `img_caption_shortcode_width` hook](https://github.com/mundschenk-at/media-credit/blob/master/includes/media-credit/components/class-shortcodes.php#L285),
   e.g. using this snippet:
 * `add_filter( 'img_caption_shortcode_width', '__return_zero' );`
 * If it’s not that, could you describe the issues you encountered in more detail
   so that I can try to fix them in one of the next releases?
 *  Thread Starter [daricedotorg](https://wordpress.org/support/users/daricedotorg/)
 * (@daricedotorg)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/disable-shortcode-but-keep-plugin-active/#post-14221889)
 * Thanks!
 * As for the width issue. An editor would insert an image with media credit in 
   the article with a 600px width for example. The original image is 1200px. The
   instruction is for them to insert it at at least 900px. Which often they don’t
   do.
 * When I edit the article and click on the edit icon on the image to adjust the
   width in the custom width option. It doesn’t take. I have to remove the media
   credit tags for the new width to take. Probably because the media credit retains
   the previous width of 600px.
 *  Plugin Author [pepe](https://wordpress.org/support/users/pputzer/)
 * (@pputzer)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/disable-shortcode-but-keep-plugin-active/#post-14229922)
 * I’ll look into it.
 *  Plugin Author [pepe](https://wordpress.org/support/users/pputzer/)
 * (@pputzer)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/disable-shortcode-but-keep-plugin-active/#post-14657713)
 * Hi [@daricedotorg](https://wordpress.org/support/users/daricedotorg/), the width
   issue will be [fixed in 4.2.0](https://github.com/mundschenk-at/media-credit/pull/127).

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

The topic ‘Disable shortcode but keep plugin active’ is closed to new replies.

 * ![](https://ps.w.org/media-credit/assets/icon.svg?rev=2570388)
 * [Media Credit](https://wordpress.org/plugins/media-credit/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/media-credit/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/media-credit/)
 * [Active Topics](https://wordpress.org/support/plugin/media-credit/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/media-credit/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/media-credit/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [pepe](https://wordpress.org/support/users/pputzer/)
 * Last activity: [4 years, 10 months ago](https://wordpress.org/support/topic/disable-shortcode-but-keep-plugin-active/#post-14657713)
 * Status: resolved