How to do search replace without partial matches messing something up?

UpdraftPlus Home Forums Paid support forum – UpdraftPlus backup plugin How to do search replace without partial matches messing something up?

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1229597
    vendors6
    Participant

    To be brief, I want to change links such as:
    example.com/contact
    to
    example.com/contact-us/

    The problem is, if it does partial matching, it will probably just mess things up. For example, it’s going to find the URL I’m trying to change it to, if it already exists. So it will already find “example.com/contact-us” as a partial match and probably change it to “example.com/contact-us-us”.
    Or it might find URLs like “example.com/contact-westside” and change to “example.com/contact-us-westside”. That sort of thing.

    I could search for “https://example.com/contact” but it might not be https, or http, or maybe a relative link that is just “/contact”. It may or may not have a trailing slash “/contact/” versus “/contact”. It might even use www or non-www. (note, I’m trying to fix all these issues, it’s why I’m doing this in the first place).

    So again I only want links pointing to /contact to be changed to /contact-us, without potentially messing up other similar links and partial matches.

    Does Updraft use regex in the search field? Is there some other trick to make sure I’m only finding “/contact” and nothing else? Maybe I need a more feature full find/replace plugin to accomplish this?

    Thanks!

    #1229598
    vendors6
    Participant
    This reply has been marked as moderator-only.
    #1230511
    Bryle Crodua
    Moderator

    Hi,

    Sorry but I think UpdraftPlus Search and Replace function is not used for this case. It is used for migration and can only search specific links/URL. I believe there would be other better plugin that can be used for that.

    Thanks,
    Bryle

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘How to do search replace without partial matches messing something up?’ is closed to new replies.