Forums

The "guid" field.. (7 posts)

  1. gutterboy
    Member
    Posted 5 years ago #

    Hey guys,

    I've wrote a script to input posts into WP in bulk; but I'm stuck on what to do to create the URL for the "guid" field in the posts table? I've looked through the coding but still find it rather confusing on what code exactly I need to execute to create this URL correctly.

    Any help?

    Thanks a lot!

  2. Kafkaesqui
    Moderator
    Posted 5 years ago #

    The guid record does *not* have to be an url. It can be any unique value; the devs decided the one of merit for a post is its permalink, but you can use any (unique) text string.

    But if you really *want* an url for this, insert something like:

    http://your.blog.site/?p=100

    The 'p' (post) query value here is just the Post's numeric ID. This is the default permalink structure for WordPress.

  3. gutterboy
    Member
    Posted 5 years ago #

    Hey... thanks!

    The current GUID's seem to be written like this..

    Post Title - GUID
    View Cookies 1.5 - http://www.*********.com/view-cookies-15-2/
    vbrowseit 1.0 - http://www.**********.com/vbrowseit-10-3/
    ULPS 1.0 - http://www.*********.com/ulps-10-2/

    If possible I wanted to keep them to the same format.. but wasn't sure exactly what it was doing?

    Thanks!

  4. Kafkaesqui
    Moderator
    Posted 5 years ago #

    The format:

    http://www.*********.com/view-cookies-15-2/

    should be easy to replicate, as it's the site url & postname (i.e. the content of the 'post_name' field) -- though I don't get the -# at the end of each.

  5. gutterboy
    Member
    Posted 5 years ago #

    Yeah... that's the part I was wondering about too.. not sure what it was doing with the numbers at the end; must be something to do with avoiding duplicate URL's??

  6. Denis de Bernardy
    Member
    Posted 5 years ago #

    guid stands for globally unique identifier. it could be a number; one can argue that a url is unique enough as well. as long as your identifier is unique, you're ok.

  7. Kafkaesqui
    Moderator
    Posted 5 years ago #

    "must be something to do with avoiding duplicate URL's"

    If you have two previous vbrowseit-10 posts, then that should be it.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags