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.

1 Answer 1


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.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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