A friend of mine has a problem. The WordPress plugin Amazon Associates Link Builder (AALB) will be discontinued on March 9, 2020. Amazon informs everyone in an article about the situation. You read in detail that after this date the plugin will no longer work because the Product Advertising API 4.0 (PA API 4) will be deprecated. Also, there is of course no more support for the WordPress plugin.

Amazon Associate Link Builder will be discontinued on 9 March 2020
Amazon Associate Link Builder will be discontinued on 9 March 2020

In short Amazon could have just written:

You’re fucked!

That would have made it quick and painless.

Their solution: Change all shortcodes from Amazon Associates Link Builder

Amazon is a bit blunt here and advises you to change the links on all pages where you have used AALB. Yes, I am that smart myself. But what if you have many pages?

There won’t be a tool to convert the shortcodes automatically. My friend is a bit lucky here, I have to admit.

As I said, the tool creates shortcodes. They start either with amazon_textlink or amazon_link. Fortunately, my friend used text links almost exclusively.

Amazon recommends, among other things, to replace the shortcode with a link to the actual product and in this format:

https://www.amazon.<marketplace>/dp/<ASIN>?th=1&psc=1&tag=<STORE-ID>&linkCode=alb

If you look at a shortcode created by AALB, you will find the parameters asin, store, marketplace and text. That’s all we need to create our own shortcode, right?

Amazon Associates Link Builder creates shortcodes like that
Amazon Associates Link Builder creates shortcodes like that

At least with an individual shortcode I can have all previous text links converted and do not have to change all the pages manually.

What does my shortcode look like to replace the links from Amazon Associates Link Builder?

If you now create your own shortcode to be able to deactivate the plugin by March 9, 2020 at the latest, it could look like this:

function amzn_func( $atts ) {
	$a = shortcode_atts( array(
		'asin' => '',
		'store' => '',
		'text' => '',
	), $atts );

	return '<a href="https://www.amazon.de/dp/'.$a['asin'].'?th=1&psc=1&tag='.$a['store'].'&linkCode=alb" target="_blank">'.$a['text'].'</a>';
}
add_shortcode( 'amazon_textlink', 'amzn_func' );

My friend can replace the Marketplace with co.uk because he only links to that. You can adapt the code to your needs and it will be added to the functions.php file of your WordPress template.

If you also use the other functions of Amazon Associates Link Builder, the shortcodes are all starting with amazon_link. Now you have to think about how you used them and waht to make with it. In the worst case you can simply replace the shortcode with a blank. This is not ideal, but at least there are no ugly shortcode fragments when Amazon discontinues off the plugin.

We have already tested it and it works. The self made shortcode will then convert the links accordingly.

Are there alternatives to AALB?

If you are searching for an alternative to AALB maybe have a look at ASA (AmazonSimpleAdmin). But since my friend primarily uses text links, he probably does not need an alternative. He still has to research the ASIN manually and can create his own shortcode. At least nobody can switch that one off.

Were you similarly annoyed yesterday when you sat in front of the e-mail announcement and saw yourself exchanging links for hours? My friend had the same experience. But maybe this post will help you to save a lot of time 😉

I don’t know why Amazon kills the plugin. It shows more than 50.000 installations. That’s quite a lot actually.

By the way, the developer of Amazon Auto Links is working on converting the shortcodes of AALB automatically. There is a beta version that should be able to do that. Right now it is discussed here if you are interested. As I said, this is not necessary for my friend because he only uses text links (he said). The best solution in this case is a hand made shortcode and not depend on a plugin again. If you want something done, do it yourself, right?

If you are searching for a VPN router — do it yourself with a Raspberry Pi. 🙂