Download
We're evolving to serve you better! This current forum has transitioned to read-only mode. For new discussions, support, and engagement, we've moved to GitHub Discussions.

URL from WordPress Import are not the same

  • #1753
    Avatar photo[anonymous]

    Hi,

    When importing posts from WordPress using the WP Importer the URLs are not exact, they change and match the Title of the post. Is there a way to choose the preferred URL from the import?

    Thanks

    #1776
    Avatar photoBob

    Hi,
    Publii generates a user and SEO friendly URLs in the way you probably have noticed. There is no way to import your own slugs into Publii.

    #1777
    Avatar photo[anonymous]

    Ok, thank you Bob. Do you think this could be a future feature of the importer?

    Importing hundreds of URLs that are already optimized for search engines (without “the”, “and”, etc) and already getting traffic, it’s a time consuming task to edit one by one. Is there any way to change them in bulk once imported?

    Thanks

    #1778
    Avatar photoBob

    I’m afraid we have no plan for that.

    #1780
    Avatar photo[anonymous]
    [anonymous] wrote:

    Ok, thank you Bob. Do you think this could be a future feature of the importer?

    Importing hundreds of URLs that are already optimized for search engines (without “the”, “and”, etc) and already getting traffic, it’s a time consuming task to edit one by one. Is there any way to change them in bulk once imported?

    Thanks

    Perhaps once imported into Publii, you could do a search and replace in the db.sqlite file (edit the slugs, etc). Though, of course, make a backup first.

    Alternatively, maybe add a 301 redirects listing in your Publii .htaccess file.

    #1781
    Avatar photo[anonymous]

    Thanks itips3727, that could work.

    #1894
    Avatar photo[anonymous]

    You can rebuild the app, it’s built with Electron. The WXR importer code is easy to read. All it needs to do is to read a field from your WXR/XML file. I manually edited the slugs but I had 43 posts, not 400, to edit.

    That the slugs don’t allow slashes is annoying since it means you need to set up redirection if you’ve used a path pattern such as/topic/year/title – which is common. I solved it by replacing slashes with underscores, used that as a slug and then set up a rewrite rule to redirect traffic to the old paths.