• Resolved jtcheng

    (@jtcheng)


    Question.

    I have outdated links sitting in the Redirection plugin that I’d like to update quickly (not manually) using the wp-cli.

    The problem is that if I have say an outdated 301 going to (as an example):
    https://some.outdated.link.com/destinations/country

    Doing a search-replace on the database like so:
    wp search-replace ‘some.outdated.link.com’ ‘newlink.com’

    …does not seem to correct the outdated link.

    So my question is:
    Where does Redirection store these 301 links? Or is there some weird way that it stores the links involving escape characters?

    I did try this:
    wp search-replace ‘%2Fsome.outdated.link.com%2F’ ‘%2Fnewlink.com%2F’
    but that didn’t yield any replacements.

    Please advise.
    Thanks

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author John Godley

    (@johnny5)

    All data is stored in the redirection tables. I’m not sure if WP CLI can update anything there, and it may cause problems if you try to do that.

    Thread Starter jtcheng

    (@jtcheng)

    Hmm…

    If I can’t do it the WP-CLI way, then how can I tell re-direction to say replace:

    Regex: true
    Source: <what do I put here to retrieve the Site URL?>/continent/north-america*
    Target: <what do I put here to retrieve the Site URL?>/destinations/north-america/

    instead of…
    Regex: true
    Old Source: ~/allacros/sandbox2/continent/north-america*
    Old Target: https://wordpress-193013-573387.cloudwaysapps.com/~allacros/wow/destinations/
    where the site URL is hard-coded into Redirection’s dialog boxes, but this requires the painful step of having to go in and manually change each redirection entry one-by-one every time I do a migration.

    Thanks

    • This reply was modified 6 years, 1 month ago by jtcheng.
    • This reply was modified 6 years, 1 month ago by jtcheng.
    Plugin Author John Godley

    (@johnny5)

    There’s no way to do that with Redirection itself. As I say, I’m not sure if WP CLI can help or if it will work. You may want to try and see, but I’d make sure to have a backup of your redirects before.

    Thread Starter jtcheng

    (@jtcheng)

    FYI: I managed to figure out a way to import a csv of old versus new URLs. I think that’s the right answer given the above restrictions.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Where does Redirection store the links’ is closed to new replies.