Support

Account

Home Forums General Issues Duplicate post_id's being created, messing up count query

Solved

Duplicate post_id's being created, messing up count query

  • Hello All,

    I’m completely stumped here as to what is going on exactly. I have an ACF field group to create a simple “in the news” profile for a post. This includes the following fields

    • news_source_name
    • article_link
    • news_source_type

    The problem I’m having is, once I’ve published my post, multiple post_id’s are being created. This wouldn’t normally be an issue since the posts are still actually called correctly by the loop, but I’m also running a seperate query that counts the numbers of different news_soure_types that have been posted. My query’s count is getting way off because of all these duplicates that are being created!

    Here are some screen shots of the situation. Has anyone else run into this??

    Thanks!

  • Hi @andrewgcross

    Looks like you are seeing postmeta data for the WP revision!

    WP creates a revision for each time you hit save on a post

  • Ah ha!!! I couldn’t find that information explicitly stated anywhere else!

    A little more careful-crafting of my SQL to only include actual posts took care of the issue right away!

    I had a feeling it probably wasn’t a ACF issue, but rather some functionality of WordPress I wasn’t aware of. Stupid me. Thank you!

Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘Duplicate post_id's being created, messing up count query’ is closed to new replies.