Forums

fixing 2 posts having same url link (15 posts)

  1. richards1052
    Member
    Posted 4 years ago #

    A friend recently imported 800 or so posts from Typepad to WP for me. He had to change the file names because TP uses a forumla with underscores .../a_man-named.html which conflicts with WP's .../a-man-named-/.

    I have 2 posts whose titles begin with the word "spring" which were written in the same month & several sets of posts written in the same month starting with "New York Times." So now I have these WP posts with the same url which makes for a mess. How can I fix this? Is there any way to rename them so they're distinct?

    "Seattle Spring Weather: O the Wind & Rain"
    "Seattle Spring Has Sprung"

    both share:

    http://www.richardsilverstein.com/tikun_olam/2005/02/seattle-spring-2/

    "New York Times Online: Ready for Digital Primetime?"
    "New York Times’ David Kirkpatrick Neglects Acknowledging Daily Kos as Blog Source for Dred Scott Article"

    share:

    http://www.richardsilverstein.com/tikun_olam/2004/10/new-york-times-/

    "New York Times Panders in Reporting the Sexualization of Girls’ Dolls"
    "New York Times Editorial Criticizes Infertility Research–Disappoints Infertile Women, Infertility Research and Journalism"

    share:

    http://www.richardsilverstein.com/tikun_olam/2003/10/new-york-times-/

    "New York Times Slums Its Way Through Blog World"
    "New York Times’ David Brooks: Sharon Sycophant?"
    share:
    http://www.richardsilverstein.com/tikun_olam/2004/05/new-york-times-/

    What do I do??

  2. Kafkaesqui
    Moderator
    Posted 4 years ago #

    Question: How did you differentiate them in TypePad?

    To solve this the only option is to perform a bit of renaming to the Post slug for one or the other of your same-named posts. There's really no way to have two or more posts of the same postname/slug in the same directory pathway.

  3. richards1052
    Member
    Posted 4 years ago #

    Typepad includes the first 4 words of the title in the post permalink whereas WP doesn't & that's where the problem lies (at least I think that's what it is).

    YOu say the "only option" is to rename the slug which sounds easy, simple & ideal. Is there any drawback to doing this?

  4. angsuman
    Member
    Posted 4 years ago #

    > So now I have these WP posts with the same url which makes for a mess.

    Why? WordPress works fine with 2 or more posts with same name. It automatically creates a disambiguating permalink.

    > How can I fix this?
    You can use a custom php script to create permalinks from the post titles. Use the WordPress function.

    However if you are also importing the permalink, then going manual is the only way.

  5. richards1052
    Member
    Posted 4 years ago #

    Nope, of all those posts above w. duplicate names it will only resolve to a single one of the posts. There's no way to find the others (at least not that I can figure out).

    I think you may be talking about 2 posts created within WP that would have a disambiguating permalink. But these posts were created within TP & then imported into WP. There's the rub.

  6. Kafkaesqui
    Moderator
    Posted 4 years ago #

    Two possible drawbacks: 1. If the links have been up for any length of time, any external sites linking to them (including search engines) may hit the wrong post. 2. Any redirection you may be using (if any) that ties TP post to WP posts will run into problems.

    Still, it really is the only option because just as you can't have the same filename for two or more files in the same directory, you can't have the same url for two or more separate posts.

  7. IanD
    Member
    Posted 4 years ago #

    Can you not add /%day%/ to your permalink structure? (unless you have posts on the same say with that title).

  8. richards1052
    Member
    Posted 4 years ago #

    IanD: I know where I would do that in the admin interface, but could you tell me what code I should insert to see if this will work & in which field?

    The posts were written in the same month but on diff. days, so theoretically your solution might work (unless someone here tells me otherwise).

  9. oriecat
    Member
    Posted 4 years ago #

    Go to Options, then Permalinks and see what it shows for your Structure.

    It looks like you are using /%year%/%monthnum%/%postname%/ if so then you could add day into it so it would be
    /%year%/%monthnum%/%day%/%postname%/

  10. richards1052
    Member
    Posted 4 years ago #

    Beautiful solution & worked like a charm.

    But since the Typepad permalink protocol uses only the month & yr. would that mean that the link redirect that I'm attempting to create (so far no luck in getting it to work) for those using my old TP permalinks would fail for my current WP permalinks since they'd all include the yr/mo/day protocol?

    When a post has the same first 3 words TP adds a numbered sequence to differentiate posts with the same first 3 words.

  11. richards1052
    Member
    Posted 4 years ago #

    Oops! I was wrong. It didn't work like a charm. Now, when I attempt to click on any recent post entry in my sidebar I get an error saying the server couldn't find it (because those links don't have the day in their permalink. What do you need to do to get this permalink structure to convert all your existing files to that format?

    I think I'll have to revert to the slug option unless the permalink structure has an easy fix.

  12. richards1052
    Member
    Posted 4 years ago #

    Kafkaesqui wrote:
    To solve this the only option is to perform a bit of renaming to the Post slug for one or the other of your same-named posts.

    So let me make sure I get this right. If 3 posts have slugs named this:

    new-york-times-

    is there a best way to rename them (new-york-times1- or new-york-times-1)?

    I just tried renaming the slugs. My problem now is that when I click View for the particular post whose slug named changed I get an error saying it couldn't be found. Do you have to rebuild the database or something to get the new slug name to register? Or what?

  13. richards1052
    Member
    Posted 4 years ago #

    I hope either IanD &/or Kafkaesqui will see this post & be able to clarify things for me.

    My problem with both the slug option & the yr/mo/day option is that they all successfully distinguish the posts. But for some reason the links to these posts within my blog don't automatically change. So for example if I change the slug name & save the post, this doesn't appear to change the post URL say in the Recent Entries section or elsewhere. I get an error msg. when I click on a hyperlink to the post or when I click "View" in the admin panel.

    Do you have to do something else to get all links to the newly renamed post to change to the new name? Otherwise, how is this a useful option?

  14. IanD
    Member
    Posted 4 years ago #

    That should be all you need to do as far as I know. You could try deleting .htaccess and regenerating it.
    You are changing the slug not the title aren't you? (just a thought) and if you go back to a post (on the edit page) whose slug you have changed, is it still what you have changed it to?

  15. richards1052
    Member
    Posted 4 years ago #

    Carthik pointed out the slight error I was making. AFter changing the slugs or yr/mo/day options you need to do a hard refresh to clear the browser cache. Oops! Thanks Carthik. After that I worked fine.

Topic Closed

This topic has been closed to new replies.

About this Topic