• Resolved mmmartin

    (@mmmartin)


    When exporting the CSV redirects from Tools->Export, the “to_url” column shows the same URL base path for both pages & posts, even though we have them configured differently.

    We have a permalink custom structure of “/blog/%postname%/” for posts and normal pages on the root.

    So when exporting, the “to_url” column, both pages & blogs appear starting as /blog/, even though pages live on the root.

    The redirect is happening correctly, is just that the export is showing the wrong URL for pages.

    Any way you can point us as to where in the code we can fix that?
    Or if there’s a setting we are not configuring correctly?

    Thanks for the help!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Aaron

    (@aaron13100)

    The code is in getRedirectsExport.sql and DataAccess.php in “function doRedirectsExport.” It doesn’t include the data you need yet.

    How do you set the base blog url for posts to one thing and set a different base url for pages in WordPress? I’ll need to know that to test the fix.

    thanks

    Thread Starter mmmartin

    (@mmmartin)

    Thanks for the quick reply!

    For the base url, I just meant that on WP Permalinks settings, we have them as a “Custom Structure” like /blog/%postname%/, which uses that for our blog posts.

    Normal pages just appear under the root by default, as /contact/, for example.

    But the export SCV shows it as /blog/contact/, when it should be just /contact/.

    Looking at the code you mentioned, it seems the URL is wrongly saved on the _permalink_cache table, so the “url” column is showing pages starting with “/blog”.

    Can you point me to where that data is saved? maybe I can modify it before it gets saved.

    The other option I see, is to check the “meta” column of that table, which seems to say if it’s a page or a post, and I can use that to strip the uneeded /blog.

    Let me know what you think?

    Thanks again!

    Thread Starter mmmartin

    (@mmmartin)

    Sorry, actually I already have the data stored like that, so need to fix it on export, not when saved.
    So probably using the meta field?

    Plugin Author Aaron

    (@aaron13100)

    Please try version 2.31.0 and let me know how it goes.

    thanks

    Thread Starter mmmartin

    (@mmmartin)

    Awesome, thanks for the quick fix!

    Tried version 2.31.2 and I see the new “wp_type” column on the export, which I can use to remove the wrong URLs from my currently saved data.

    Thanks again! Issue fixed.

    • This reply was modified 2 years, 5 months ago by mmmartin.
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Exporting CSV with incorrect “to_url”’ is closed to new replies.