• About a month ago, Amazon.com changed their Affiliates Program codes and required any bloggers to change a phrase in the codes to something else. They provided a Dashboard to track this but have since turned it off and like many writers using WordPress with these codes to purchase medium, I still had thousands of posts and codes to swap. The text is below for review.

    – Find and replace ws.amazon.com with ws-na.amazon-adsystem.com
    – Find and replace rcm.amazon.com with rcm-na.amazon-adsystem.com

    Is there any way to do a global search and replace for the bad phrase to replace with the new good one because who has time to sit and append thousands of posts like this.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Moderator t-p

    (@t-p)

    check this plugin and see if it will work for you:
    https://wordpress.org/plugins/cm-on-demand-search-and-replace/

    Hello kennypierce,

    You can actually search and replace your post content by accessing your database and running a specific query. Log into your hosting provider account and access your cpanel. Then you want to click on the phpMyAdmin icon. Once you are in, click on the name of your database and once there you will see a list of tabs across the top. Choose the SQL tab and use the below query to find and replace your amazon phrases:

    UPDATE wp_posts SET post_content = REPLACE ( post_content, ‘text to find here’, ‘text to replace here’);

    Be advised that messing with your database directly can seriously mess up your website if done incorrectly so please do this with caution.

    Thread Starter kennypierce

    (@kennypierce)

    Thanks Tara I will take a look at that one and WPDEV, I have heard this before but I am so scared to mess that deep into my website’s actual database. Its bad enough I am adding my legacy static website into this piece by piece. Too bad Amazon.com themselves didn’t offer a reliable tool to help us with this.

    Thread Starter kennypierce

    (@kennypierce)

    So when I could not make the suggested plugin work, I wrote to their support and they said “we do not support the free plugin”. Apparently the free one does not do the trick or even work. Once again here is the issue I have to address.

    Amazon.com changed their affiliate code and this is something placed in posts generally at the end of the text. The old text of rcm.amazon.com needs to be replaced by a different phrase. Since over 1400 posts of mine seem to have this code, and many have numerous instances of it, I need something that lets me replace the text in the posting not something in a database deep in the root of the thing. It’s very frustrating and I think Amazon.com handled this improperly.

    I am rebuilding my site still from the old static design and after one year am not even half done so to have to go back to the beginning and edit affiliate code post by post by post is just not something I have the time for.

    Anyone?

    You should try what @wpdevsolutions suggested. Just backup your database first.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How To Global Search and Replace in WordPress Posts’ is closed to new replies.