• Hello, I tried replacing a text with a link (in order to that some better internal linking because when creating pages I forgot to add link on some texts which is on lots of pages)

    -while replacing a text with another text, it works fine
    -but when replacing a text (I always chose specific part of text which is not anywhere else on site) with a link (so I type the html)
    Replacing works, I saw the link but the page is broken….I can add screenshot if you want….(problem could be elementor related ?)

    I then, to the task in reverse so that the page is not broken anymore

    can you confirm me that replacing a text with a link is possible ?
    thanks.

Viewing 15 replies - 1 through 15 (of 15 total)
  • Hi there!

    Better Search Replace Support Team here, Thanks for reaching out with your query we would be happy to assist!

    Yes, you should be able to replace a text with a URL using the plugin.

    Would you mind providing the exact search and replace term you’re using? Please also provide a link to a page where the text you’re replacing exists so we can investigate. The screenshot of the broken page would also be helpful.

    Thread Starter Gérald Mardirossian

    (@gerald-mardirossian)

    hello again and thank you for your reply
    here is an example of what I am trying to do

    on a page like this one
    https://google-ads.virtueltime.com/agence-google-ads-nice/
    I have the same text block on all kind of pages and I had forgotten to insert links on a text block

    so I want to replace
    I do search for

    secteurs : logiciel, luxe, joaillerie, beauté, immobilier, finance,

    and replace by

    secteurs : logiciel, luxe, joaillerie, beauté, <a href=”https://google-ads.virtueltime.com/gestion-de-campagnes-google-ads-secteur-immobilier/“>immobilier</a>, finance,

    I have selected only the wp_postmeta table

    Is there something wrong of the way I am doing it ? (I could also add the screenshot of the page after replacing, you will see that it is broken )))

    Hi @gerald-mardirossian,

    How many results does the plugin say that it replaces? Is it always only 1?

    Also, kindly share a screenshot of the page after replacing.
    And if possible, kindly share the ‘Page Source’ of the page afterwards.

    Looking forward to your response,
    Thank you.

    Thread Starter Gérald Mardirossian

    (@gerald-mardirossian)

    hello again
    quick question here : is the good table to replace is wp_postmeta or wp_post ? or both ?

    here I tried again replacing like I described earlier, this time page didn’t break (wondering if it is because some updates of other plugin between the two tests….)
    but now, I don’t see the link being changed….like search replace didn’t do the magic….
    I saw 253 cells updated and 253 updates, but no link appeared…

    I tried emptying cloudflare cache to see if any changes were hidden… but still same page as before…
    I could do a recording of my screen to show you If you want…I am maybe just not doing it well…but I don’t see where is my mistake…

    thank you for your help

    Hi @gerald-mardirossian,

    If you’re trying to replace a content inside a page and posts, please include the wp_posts table.

    Page and posts contents are stored in the wp_posts table while wp_postmeta is for any extra information about those posts. More info here –

    https://deliciousbrains.com/tour-wordpress-database/#wp_posts

    If you haven’t included wp_posts yet, we would suggest retrying another find and replace but this time please include both wp_posts and wp_postmeta tables and see how that goes.

    As always, please create a database backup first before making any changes to your database.

    Thread Starter Gérald Mardirossian

    (@gerald-mardirossian)

    thank you for your help

    I have tried a few things here but with not much luck….(I used to be able to replace at least text, but in this example I didn’t work….)

    https://gemoo.com/tools/upload-video/share/651265683664019456?codeId=MpOj8ogrQd8Qm&card=651265680220495872

    Hi @gerald-mardirossian,

    Based on the screen recording, it seems the plugin wasn’t able to find those texts. Posts and pages are stored in the wp_posts?and?wp_postmeta tables by default. If the texts are added via a plugin, they might be saved in a custom table.

    Please also check how those texts are saved in the database. Sometimes, certain characters are saved as entity names/numbers.

    Thread Starter Gérald Mardirossian

    (@gerald-mardirossian)

    hello again, I did some new tests
    this time plugin has made changes more than 700 hundreds
    but page gets broken like it used to
    here is screenshot
    page becomes like this > https://ibb.co/1qQZkgc

    here is replaced “traiteur, appli mobile, café, thé,” with “traiteur, appli mobile, café, thé,”

    Hi Gérald,

    Are you using a builder plugin? It’s possible that the links are saved differently in the database. They could be escaping the slashes with backslashes, and so you might need to escape the URLs as well.

    Could you create a test page for us (maybe a copy of that page you are editing) where you can replicate the issue with the broken page after the search/replace? This way we can inspect how the page broke.

    Thread Starter Gérald Mardirossian

    (@gerald-mardirossian)

    I am using elementor and also Elementor Header & Footer Builder (for this block)

    about this “and so you might need to escape the URLs as well.” > could you tell me exactly what I should type to be sure I understand what you mean )))

    about this “Could you create a test page for us (maybe a copy of that page you are editing) where you can replicate the issue with the broken page after the search/replace? This way we can inspect how the page broke.” > I could copy and paste the code source after the page breaks if you want ?

    Hi @gerald-mardirossian,

    could you tell me exactly what I should type to be sure I understand what you mean

    From previous reports, it seems Elementor may be saving URLs differently where slashes are escaped with backslashes.

    So “<u>https://example.com</u&gt;\/example-url” becomes “http:\/\/<u>example.com</u>\/example-url”.

    You may want to try searching for the URL but with the forward slashes escaped as mentioned above, or you could use a tool like PHPMyAdmin to take a look at the URLs in MySQL and see what the proper search term should be.

    I could copy and paste the code source after the page breaks if you want ?

    We would prefer a test page where this issue can be replicated as that would be the best way we can inspect things as closely as possible.

    But in this case, we would first suggest identifying how the URLs are exactly stored on your database and then retrying another search and replace based on that.

    Sorry, looks like the format of the example URLs were broken. It should be something like this instead:

    “https://example.com\/example-url” becomes “http:\/\/example.com\/example-url”

    Thread Starter Gérald Mardirossian

    (@gerald-mardirossian)

    hello again,
    and thank you for your help

    I tried following your tutorial and tried again (didn’t work …but I think we are almost there and getting close)

    this time I did this


    search for
    rents secteurs : logiciel, luxe, joaillerie,
    and replace by

    rents secteurs : <a href="https:\/\/google-ads.virtueltime.com\/gestion-de-campagnes-google-ads-logiciel-saas">logiciel<\/a>, luxe, joaillerie,

    page breaks like it used too… but I can see the link on the page
    also code source looks like this when inspecting

    https://ibb.co/wNbRxBm
    looks like there is something weird going on with the ” ”

    do you see something I can’t see ?

    thanks

    Hi Gérald,

    Thanks for the additional information. It seems the <a> tag is getting wrapped around quotes for some reason.

    After you run the search/replace, do you view the page using the Elementor editor page? Have you tried viewing the page directly (maybe in incognito mode)?

    Maybe viewing the page in Elementor mode adds some extra formatting around URLs. Perhaps they have their own format when saving URLs in the database. You may have to contact Elementor support about that information.

    Let us know how it goes for you.

    Thread Starter Gérald Mardirossian

    (@gerald-mardirossian)

    if it can help anyone,
    I ended up using shortcode solution (shortcoder)… I replaced the whole section I needed to update with a shortcode, thereforce allowing me to update the block at once… made life easier than the other way around

Viewing 15 replies - 1 through 15 (of 15 total)
  • You must be logged in to reply to this topic.