Title: Hide slug when shortcode is deactivated?
Last modified: August 21, 2016

---

# Hide slug when shortcode is deactivated?

 *  Resolved [It’s Thomas!](https://wordpress.org/support/users/itsthomas/)
 * (@itsthomas)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/hide-slug-when-shortcode-is-deactivated/)
 * Hi there,
 * I have been using the my shortcodes – plugin for some time now and it has made
   wordpress-life already easier for me. Still, I wonder if it’s possible to have
   the slug hidden when the depending shortcode is deactivated. For example:
    I 
   have a shortcode with the slug [season] and the html content “2013”. Now when
   I put [season] in one of my wordpress articles, it shows as “2013” as long as
   the shortcode is activated. But when it’s deactivated, it shows the slug [season],
   which doesn’t look very good 😉 . Is there a way to have the slug hidden while
   the shortcode is deacitvated?
 * Thanks so much in advance!
 * Thomas
 * [http://wordpress.org/plugins/my-shortcodes/](http://wordpress.org/plugins/my-shortcodes/)

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

 *  Plugin Author [David Cramer](https://wordpress.org/support/users/desertsnowman/)
 * (@desertsnowman)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/hide-slug-when-shortcode-is-deactivated/#post-4044083)
 * Well that is the thing with WordPress in general.
 * You could just make a secondary shortcode with the same slug but no template 
   then alternate their state.
 *  Thread Starter [It’s Thomas!](https://wordpress.org/support/users/itsthomas/)
 * (@itsthomas)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/hide-slug-when-shortcode-is-deactivated/#post-4044102)
 * Hi David,
 * thanks for your fast response and your suggestion. I tried it but it didn’t work:
 * I created a second shortcode with the same slug and a different html code, hoping
   that when I switch off the first shortcode and activate the second, then the 
   second html would also be displayed. But it wasn’t – it kept displaying the html
   from the first shortcode, even if the first one was deactivated and the second
   was activated.
 * To be sure, I also tried it exactly as you said: The second shortcode without
   any html / template, but it still kept displaying the html of the first shortcode…
 * Hmmm – Could I have done something wrong?
 *  Thread Starter [It’s Thomas!](https://wordpress.org/support/users/itsthomas/)
 * (@itsthomas)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/hide-slug-when-shortcode-is-deactivated/#post-4044180)
 * David,
 * do you think you could implement this feature in your plugin: being able to switch
   between two (or more) shortcodes with the same slug but different contents?
 * That would be awesome!
 * Thanks so much
    Thomas
 *  Plugin Author [David Cramer](https://wordpress.org/support/users/desertsnowman/)
 * (@desertsnowman)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/hide-slug-when-shortcode-is-deactivated/#post-4044195)
 * Hi Thomas,
    I did some testing and found that it would always use the code from
   the first. I’ll make a fix for it asap.
 *  Plugin Author [David Cramer](https://wordpress.org/support/users/desertsnowman/)
 * (@desertsnowman)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/hide-slug-when-shortcode-is-deactivated/#post-4044196)
 * I have just pushed an update that will fix this.
    now you can alternate between
   two of the same slug elements and it will only use the active one.
 *  Thread Starter [It’s Thomas!](https://wordpress.org/support/users/itsthomas/)
 * (@itsthomas)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/hide-slug-when-shortcode-is-deactivated/#post-4044197)
 * Hi David,
 * thanks so much for releasing an update to fix this issue!
 * One last question before I mark this thread as solved (and give your plugin a
   5 star rating 😉 ):
 * This alternating is also possible with more than two elements with the same slug,
   I assume? Theoretically, with limitless elements with the same slug – is it not?
 *  Plugin Author [David Cramer](https://wordpress.org/support/users/desertsnowman/)
 * (@desertsnowman)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/hide-slug-when-shortcode-is-deactivated/#post-4044224)
 * I’m so sorry I missed this.
    You can theoretically have many elements with the
   same slug, but only 1 activated at a time.

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

The topic ‘Hide slug when shortcode is deactivated?’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/my-shortcodes_f6e3df.svg)
 * [My Shortcodes](https://wordpress.org/plugins/my-shortcodes/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/my-shortcodes/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/my-shortcodes/)
 * [Active Topics](https://wordpress.org/support/plugin/my-shortcodes/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/my-shortcodes/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/my-shortcodes/reviews/)

 * 7 replies
 * 2 participants
 * Last reply from: [David Cramer](https://wordpress.org/support/users/desertsnowman/)
 * Last activity: [12 years, 3 months ago](https://wordpress.org/support/topic/hide-slug-when-shortcode-is-deactivated/#post-4044224)
 * Status: resolved