Support » Everything else WordPress » Two database entries per post?

  • Resolved roro


    When I post a new entry on my blog (wordpress 2.x), two entries are stored on my database, (wp_posts) the usual one and another for the ALT i used on the image (is a photoblog).

    Why is this happening? Im the only one with this problem?

Viewing 8 replies - 1 through 8 (of 8 total)
  • Are you experiencing a problem?

    The image normally creates another entry into wp_posts.

    No, not a problem, I just surprised and want to know if this is normal, im using wp since it was b2 and just upgrade from wp 1.2 and didnt expected that.

    thanks for the reply.

    Actually I should point out that each image, even if not attached to a post, gets an entry in wp_posts.

    Have fun with the new and improved WordPress.

    so if I upload a photo with another script or ftp, i only get one entry per post?

    because i really dont get the point of this, sorry im a control freak 🙂

    Moderator Samuel Wood (Otto)

    (@otto42) Admin

    If you upload a file via the Write Post page’s file uploader, it creates an entry in the posts table. This is a fake post, used to hold meta information about the file. It will have a post_status of “attachment” or something like that. You can safely ignore it, that’s what it is supposed to do.

    In the case of uploading pictures, the post entry holds info like the size of the picture, the location of the auto-generated thumbnail, the description you gave it, etc.

    Part of being a control freak is understanding what it is you feel the urge to control.

    As noted, with WP 2.x and the advent of the new image management “stuff”, uploaded images get their own record in wp_posts. Yes, it is intentional.

    You certainly are not forced to use the built-in image uploader. There are several plugins that replace it and, of course, ftp and the knowledge of how to craft a simple <img> tag are also options.

    But I’ll admit this is the most unusual reason given for not using it I’ve ever seen here. 🙂

    Well, in case i want to migrate to another CMS I find more complicated with this “extra” entries on the post table.

    I like my databases easy to modify or export etc.

    Thanks to all, this post is now resolved!

    Moderator Samuel Wood (Otto)

    (@otto42) Admin

    roro: Not all that complicated. Just add a where clause to filter out the post_status = ‘attachment’. Or export the thing as a big RSS feed or something. Considering the effort involved to migrate directly to anything else anyway (custom queries and such), it’s not all that big of a deal.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Two database entries per post?’ is closed to new replies.