Title: Short code removed after editing code
Last modified: August 21, 2016

---

# Short code removed after editing code

 *  Resolved [dorich](https://wordpress.org/support/users/dorich/)
 * (@dorich)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/short-code-removed-after-editing-code/)
 * On WP 3.7 and Shortcode UI 1.9.8 I have the following symptom.
 * Insert php into the appropriate box.
    Set the short code name and the short code
   type. Publish and the short code appears on the list. In addition it appears 
   in the post. However, it appears that I have an error in my php. So I go back
   and edit the content of the php box.
 * Now comes the problem.
    When I click on update, the Shortcode is converted to
   a post. It is removed from the short code list and appears in the post list. 
   I’ve repeated this many times and I cannot stop this happening. In addition I
   removed the plugin and reinstalled but I still get the same result.
 * Is this a problem with 3.7 and the plugin?
 * [http://wordpress.org/plugins/shortcodes-ui/](http://wordpress.org/plugins/shortcodes-ui/)

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

 *  Thread Starter [dorich](https://wordpress.org/support/users/dorich/)
 * (@dorich)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/short-code-removed-after-editing-code/#post-4406958)
 * Update:
 * I tried an experiment with a simple text short code.
    The short code was shown
   in the short code list and was being inserted into a page where the short code
   was used.
 * Then I edited the contents of the short code and upon clicking update it was 
   converted to a post and removed from the short code list.
 *  [GenealogyCoach](https://wordpress.org/support/users/samatva/)
 * (@samatva)
 * [12 years ago](https://wordpress.org/support/topic/short-code-removed-after-editing-code/#post-4407377)
 * I had a similar problem, found a plug in conflict – in my case, with Post Type
   Switcher… Shortcodes UI is much more important for my site.
 *  I did find that I could enable the Post Type Switcher plugin when needed, then
   disable it before editing any short codes.
 *  [conrad90](https://wordpress.org/support/users/conrad90/)
 * (@conrad90)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/short-code-removed-after-editing-code/#post-4407387)
 * Hi, sorry to hijack this thread but I couldn’t see where else to contact you.
 * I am having the exact same problem as you posted here:
    [http://wordpress.org/support/topic/jquery-not-working-1](http://wordpress.org/support/topic/jquery-not-working-1)
 * You closed the topic, so I assume you were able to resolve this, but you did 
   not post what the solution was…?
 * I have scoured the web high and low and have not been able to make any progress.
   Please get in touch/reply if you can help! I am sure this will also be of use
   to others.
 * Thanks
 *  Thread Starter [dorich](https://wordpress.org/support/users/dorich/)
 * (@dorich)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/short-code-removed-after-editing-code/#post-4407388)
 * [@conrad90](https://wordpress.org/support/users/conrad90/)
    Apologies but I don’t
   recall the solution. My best guess is that it had something to do with registering
   and enqueueing scripts but I can’t be sure.
 *  [conrad90](https://wordpress.org/support/users/conrad90/)
 * (@conrad90)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/short-code-removed-after-editing-code/#post-4407389)
 * Thanks for the reply – I have figured it out. For the record, it is a multi-step
   process:
 * You need to place your JS in a file of its own (not include in the head), and
   save this in the JS folder in your WP install.
 * Then in functions.php you need to enqueue this script with a url pointing to 
   it. This allows WP to recognize it as kosher/compatible. As far as I can tell,
   you don’t need to ‘register it’, only enqueue it.
 * Then, the head (or body, I assume, but head worked for me), you call this script
   as you would if you had simply embedded the script in the head in a non-WordPress
   situation.
 * The exact code for each section of this obviously depends on your purposes, but
   this is the generic process needed to get anything working. Why this isn’t stated
   so clearly elsewhere on the web is a mystery to me. Hope this helps someone!
 *  [conrad90](https://wordpress.org/support/users/conrad90/)
 * (@conrad90)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/short-code-removed-after-editing-code/#post-4407390)
 * And yes, you do need to replace the $ signs with jQuery – with an uppercase Q–
   in the head/body section when you call the script. But not in the file in the
   JS folder that gets enqueued – that one can use regular $ signs.
 *  Thread Starter [dorich](https://wordpress.org/support/users/dorich/)
 * (@dorich)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/short-code-removed-after-editing-code/#post-4407391)
 * [@conrad90](https://wordpress.org/support/users/conrad90/)
    I’m a neophyte on
   this subject but I believe that the process of linking to JS files is to register
   them in the functions file, so they are now universally available by calling 
   their handle. Then, still in the functions file, you can call them on a page 
   by page basis, using the enqueue function. This set up method also provides control
   over the dependency of the scripts. For example since you want the jQuery library
   to load before the script in question you can define the dependency in your registration.
   That way the library will load before the script in question.
 * In this manner WP does the work for you and there is no need to add the script
   to the header.
 * Regarding the use of $, I think you will find that you can use
    jQuery(document).
   ready(function($) {}) …. and from then on in your script you can use $
 * The codex reference is [here](http://codex.wordpress.org/Function_Reference/wp_enqueue_script#jQuery_noConflict_Wrappers).

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

The topic ‘Short code removed after editing code’ is closed to new replies.

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

 * 7 replies
 * 3 participants
 * Last reply from: [dorich](https://wordpress.org/support/users/dorich/)
 * Last activity: [11 years, 10 months ago](https://wordpress.org/support/topic/short-code-removed-after-editing-code/#post-4407391)
 * Status: resolved