• Hello I would like to renumber the IDs in the wp_post table and I would like to know if this is a bad thing… is something going to break if I do? are these posts referenced in other places?
    it’s a pretty new installation of WP so there are no comments or anything like that, but I am not sure if the IDs of the posts only appear in wp_post table or if they also appear in other places
    please let me know

Viewing 11 replies - 1 through 11 (of 11 total)
  • Yes – it’s very bad. You will end up with a broken site.

    Thread Starter marcnyc

    (@marcnyc)

    well how can I go about this if I need to do it?
    if you are wondering, the reason I need to do it is because I have installed Intense Debate as a commenting system for my WP posts but I have also added Intense Debate to some non-WP content that needed a commenting system, so now when somebody comments on a non-WP item with id=15, then the same comment appears on the WP post with id=15

    I was thinking of basically renumbering all the WP posts by adding ‘100000’ in front of the IDs so that ID 15 will become ID 10000015

    Would that not work?

    I’d suggest renumbering the ids on your non-WP content. Perhaps prefix them with a single alphabetic character to ensure that they remain distinct from WP posts?

    Thread Starter marcnyc

    (@marcnyc)

    That’s a great idea!
    Can I add a word in front of an ID or do IDs need to always be numbers only?
    Thanks for this suggestions

    Where/how are you storing your non-WP content?

    Thread Starter marcnyc

    (@marcnyc)

    the non-WP content is stored in a database (different than WP, but on the same machine).
    the IDs are numerical and I wonder if I can just change the code of the intensedebate javascript and add a ‘reviews_’ prefix to the IDs generated from the database so that the review with ID ’15’ will have an intensedebate ID of ‘review_15’

    you can see what I am talking about at https://www.chaindlk.com
    all the WP posts are in https://www.chaindlk.com/news
    and the non-WP content are in https://www.chaindlk.com/reviews

    You could strip review_ from the ID just before retrieving the comment from the non-WP db but after the script/plugin has determined which db to use.

    Or you could amend your db and add an extra field that literally stores review_x where x = the comment (or should that be post?) id when the comment is submitted. Then amend the plugin to run it’s query based on the new field and not the ID field. If you see what I mean…

    Thread Starter marcnyc

    (@marcnyc)

    Not sure I follow you… Right now I didn’t add the review_ prefix to the ID in the database because I already have more than 5000 reviews in there… I just added the review_ prefix to the ID associated to the comment (I did this by adding the prefix in the javascript that you put in your non-WP pages to have IntenseDebate there)… it seems to work, I was just wondering if I should us a text prefix or if I should add a 100000 prefix… is one more correct? or can IDs be non-numerical?

    can IDs be non-numerical

    That depends upon your database structure. They’re commonly numerical and auto-incremented as each record is added to the relevant table.

    Thread Starter marcnyc

    (@marcnyc)

    any idea what the IntenseDebate database structure is like?

    Sorry – I’ve never used that plugin but I’d guess that it uses a numerical ID.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘is renumbering IDs in wp_post table bad?’ is closed to new replies.