WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

With regards the menu item id's WP generates such as menu-item-814, are these 100% unique in nature?

I know they are unique at the time, but are they always unique? Meaning that if I was to delete something that had the id of 814, is it possible that some other menu item could now be assigned this ID? ...or if WordPress was updated do they still keep the same ID's?

I ask because I want to assign something to a certain menu button via JavaScript but on the off chance the button is removed I don't want to be applied to a new button that has now been assigned that ID.

share|improve this question
up vote 5 down vote accepted

Yes it is always unique. id 814 cant be applied again unless you update it manually on your DB. Its because of auto increment .. DB automatically increment id so everytime next id will be +1




and so on.. Even if you delete an id in between. It wont affect auto incrementation.

Read MY SQL AUTO_INCREMENT for detailed understanding.

share|improve this answer
Yep, know how auto increment works, just wasn't sure if that was what WP used for this. Thanks! – Brett Sep 17 '12 at 18:05

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.