Support » Plugin: Better Search Replace » Search & Replace within elementor texts?

  • Agnes

    (@agneslesagegmailcom)


    Hi, I have been using this plugon en numerous sites. Now I also use elementor on most sites, and unfortnunately, it seems that search and replaces does not work wll.
    It does find strings, it tells me it replaces them… but nothing changes on the front end.
    Any hint?
    Thanks, Agnes

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

Viewing 7 replies - 1 through 7 (of 7 total)
  • Yes I seem to be having this same problem. The Better Search Replace plugin has been my go to plugin for replacing links, I have used it on dozens of sites successfully. But my site that uses Elementor doesn’t seem to get updated as expected, the links on the pages don’t seem to get updated.

    Not sure why this plugin doesn’t work, but Elementor seems to be aware of the issue because they have this solution: https://docs.elementor.com/article/218-i-changed-the-url-of-my-website-and-elementor-does-not-work-anymore

    The problem is still not fixed. I have the same problems.

    Hunk Han

    (@mysolutionstech)

    I have the very same problem! How can we fix it, please…

    Same here – this plugin is my go-to for search & replace, but seems to have no effect on Elementor pages

    Agnes

    (@agneslesagegmailcom)

    I wonder if this issue should not be rather located with Elementor team, because it may have to do with the way Elementor stores data in in the database and upon “publish”..?

    horizonsinc

    (@horizonsinc)

    First things first. Take a backup and VALIDATE that it works. Now…

    To search and replace links in Elementor managed posts and pages you must modify your search string from what works on ‘normal’ wordpress posts/pages.

    Elementor most likely escapes characters used in your find/replace strings such as / or “. For instance let’s say you want to add a trailing slash to links pointing to your contact page site wide. You want to convert https://yoursite.com/contact to https://yoursite.com/contact/

    You probably ran update operations like:

    Search for: "https://yoursite.com/contact"
    Replace with: "https://yoursite.com/contact/"

    This probably worked on any text outside of Elementor and left Elementor content untouched.

    The tricky thing is normal posts and pages are NOT escaped the way Elementor posts and pages are stored, PLUS both sets may have both absolute and relative URLs. To make matters worse you may also have http and https links thrown in the mix. To catch all of those possibilities you’ll need to run 11 operations on your posts and postmeta tables.

    Normal WP Posts/Pages:

    Absolute URLs - Search for: (3 separate operations)
    "http://yoursite.com/contact"
    "http://yoursite.com/contact/"
    "https://yoursite.com/contact"
    Replace with: 
    "https://yoursite.com/contact/"
    
    Relative URLs Search for:
    "/contact"
    Replace with: 
    "/contact/"

    Elementor Posts/Pages:

    Absolute URLs Search for: (3 separate operations)
    \"http:\/\/yoursite.com\/contact\"
    \"http:\/\/yoursite.com\/contact\/\"
    \"https:\/\/yoursite.com\/contact\"
    Replace with: 
    \"https:\/\/yoursite.com\/contact\/\"
    
    Relative URLs Search for:
    \"\/contact\"
    Replace with: 
    \"\/contact\/\"

    Seems like certain Elementor widgets can also store without escaping the enclosing quotes so additional operations are needed to change everything:

    Absolute URLs Round 2 - Search for: (2 separate operations)
    "http:\/\/yoursite.com\/contact"
    "https:\/\/yoursite.com\/contact"
    Replace with: 
    "https:\/\/yoursite.com\/contact\/"
    
    Absolute URLs Round 2 - Relative URLs Search for:
    "\/contact"
    Replace with: 
    "\/contact\/"
    • This reply was modified 5 months ago by horizonsinc. Reason: formatting
Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.