Amazon Auto Links

plugin banner

Generates links of Amazon products just coming out today. You just pick categories and they appear even in JavaScript disabled browsers.

Author:Michael Uno (miunosoft) (profile at wordpress.org)
WordPress version required:3.4
WordPress version tested:5.9.3
Plugin version:5.2.9
Added to WordPress repository:10-09-2012
Last updated:14-05-2022
Rating, %:88
Rated by:56
Plugin URI:https://en.michaeluno.jp/amazon-auto-links
Total downloads:893 608
Active installs:10 000+
plugin download
Click to start download

Display Amazon Associates Affiliate Links with Minimal Effort

Still manually searching products and pasting Amazon affiliate links in WordPress posts? What happens if the products get outdated? With this plugin, you do not have to worry about it nor trouble doing such repetitive tasks. Just pick categories that suit your site and it will automatically display the links of decent products just coming out from Amazon today.

Auto Amazon Links is a WordPress plugin for affiliates to create Amazon affiliate links. The links are tagged with your Amazon Associates ID. All the Amazon locales are supported and it works even on JavaScript-disabled browsers. Insert the ads as widget, place shortcode, or use auto-insert to display units automatically where the links should appear.

If you want to search for a specific product, yes, you can do that too. If you are good at HTML and CSS coding and know a little about PHP, you can create your own template! That means you can design the layout.

Display Amazon affiliate links along with your posts with this plugin to earn commissions with minimal effort.

Display a particular product in a post

If you want to simply display your desired specific products in a post, don’t worry. You can do that too. Just paste the product URL into the post editor. No shortcode is required.

See How Amazon Affiliate Links are Displayed

Supporting All the Amazon Associates Locales

Includes Australia, Brazil, Canada, China, France, Germany, India, Italy, Japan, Mexico, Netherlands, Poland, Singapore, Saudi Arabia, Spain, Sweden, Turkey, United Arab Emirates, United Kingdom, and the United States. China is supported for the category unit type.

Works without JavaScript

Some visitors turn off JavaScript in their browsers for security reasons and most ads including Google Adsense will not show up to them. But this one works!

Automatic Insertion in Posts and Feeds

Just check where you want the product links to appear with auto-insert.

  • Static Contents Conversion – If you want the product link to be static, it is possible. This means that if you deactivate the plugin, the converted contents will remain.
  • Detailed Visibility Criteria – You can enable/disable product links on the pages you want or do not want by post ID, taxonomy, page type, and post type.

Customizable Buttons

Your site visitors are more likely to click buttons than regular text hyperlinks. Define your custom buttons and insert them into the unit output.

The plugin lets you design buttons through UI and prepares several default buttons for you so that you can modify them rather than create your own from scratch.

Geo-targeting

You can transform your Amazon affiliate links into the ones of the locale that the site visitor resides, presumed by IP address. So you won’t miss commission fees from visitors coming outside of your country.

Auto Link Conversion

Hyperlinks to Amazon products in posts and comments can be transformed into your associate affiliate links. This is useful if your site allows guests to post contents that include Amazon links.

Gutenberg Block

The plugin has a Gutenberg block that lets you pick units you created, which can save a little time than typing the shortcode.

Widgets

Place the widget in the sidebar and select the unit you created. The product links will appear where you want.

  • By Units – choose the created units to display in the widget.
  • Contextual Search – with this, you don’t have to create a unit. It will automatically search products relating to the currently displayed page contents.

Shortcode and PHP Function

Insert the ads in specific posts and pages with the shortcode. If you want to insert in the theme template, use the PHP code the plugin provides to produce the outputs.

Filtering Products

You can filter out certain products you don’t want to display with a black and white list by description, title, and ASIN.

RSS and JSON Unit Feeds

By subscribing to the product RSS/JSON feeds of the units you create, you can import them from other sites.

If you have a website that can display RSS feed contents, just create a WordPress site somewhere with this plugin and fetch the feed from the site. If you are an App developer, you can just display the items from the feed without programming an API client.

Various Unit Options

  • Image Size – The size of thumbnails can be specified. It supports up to 500 pixels large with a clean resolution.
  • Sort Order – Shuffle the product links so that the visitor won’t get bored as it gives refreshed impression.
  • URL cloaking – You can obfuscate the link URLs so it helps to prevent being blocked by browser Ad-blocking add-ons.
  • Load with Javascript – Decides whether to display units with JavaScript.
  • and more.

Customizing Outputs

Besides the Item Format unit option which lets you design the output of a unit, you can create a custom template. This gives you freedom of customization and lets you achieve a more advanced and detailed design.

Unit Types

  • Category – picks your category that matches your site topic.
  • Product Search – creates a unit by performing product searches.
  • URL – lists items from an external web source.
  • PA-API Product Search – creates a unit of a search result using PA-API.
  • PA-API Item Look-up – displays specific products.
  • PA-API Custom Payload – is for more complex PA-API queries.

Supported Languages

  • English
  • Japanese
  • German
  • Italian
  • Spanish

Getting Started

Please see the Installation section.

Shortcode and Function Parameters

The plugin provides means to display Amazon product links by manually inserting a piece of code into your post or a theme file. For posts, it’s called shortcode. For theme files, you need to place a PHP function. Using these, you even don’t have to create a unit.

  • Shortcode:
    • [amazon_auto_links]
  • PHP Functions:
    • do_action( 'aal_action_output' );
    • apply_filters( 'aal_filter_output' );

They both takes the following arguments.

id – the unit ID

[amazon_auto_links id="123"]
<?php do_action( 'aal_action_output', array( 'id' => 123 ) ); ?>
<?php echo apply_filters( 'aal_filter_output', '', array( 'id' => 123 ) ); ?>

label – the label associated with the units

[amazon_auto_links label="WordPress"]
<?php do_action( 'aal_action_output', array( 'label' => 'WordPress' ) ); ?>
<?php echo apply_filters( 'aal_filter_output', '', array( 'label' => 'WordPress' ) ); ?>

asin – ASINs (product IDs) separated by commas (`,`).

[amazon_auto_links asin="B016ZNRC0Q, B00ZV9PXP2"]
<?php do_action( 'aal_action_output', array( 'asin' => 'B016ZNRC0Q, B00ZV9PXP2' ) ); ?>
<?php echo apply_filters( 'aal_filter_output', '', array( 'asin' => 'B016ZNRC0Q, B00ZV9PXP2' ) ); ?>

search – Search keywords separated by commas (`,`).

[amazon_auto_links search="WordPress"]
<?php do_action( 'aal_action_output', array( 'search' => 'WordPress' ) ); ?>
<?php echo apply_filters( 'aal_filter_output', '', array( 'search' => 'WordPress' ) ); ?>

When the search argument is specified, the following arguments can be used.

  • SearchIndex – Filters search results by category. For accepted values, see the locale reference. For example, the US locale, e.g. [amazon_auto_links search="Oven" SearchIndex="Electronics"]
  • Sort/SortBy – (PA-API required) Sort order. Accepts the following values: AvgCustomerReviews, Featured, NewestArrivals, Price:HighToLow, Price:LowToHigh, Relevance. For the details of each value, see here. e.g. [amazon_auto_links search="WordPress" sort="AvgCustomerReviews"]
  • BrowseNode/BrowseNodeId – (PA-API required) Filters search results by category ID.
  • Availability – (PA-API required) Filters search results to items with the specified product availability status. Accepts Available or IncludeOutOfStock. See details.
  • MerchantId/Merchant – (PA-API required) Filters search results to items with the specified merchant. See details.
  • Condition – (PA-API required) Filters search results to items with the specified product condition. Accepts Any, New, Used, Collectible or Refurbished. See details.
  • MaximumPrice/MaxPrice – (PA-API required) Filters search results to items with a price below the specified price. The value needs to be formatted in lowest currency denomination. For example, in the US marketplace, set 1234 for $12.34.
  • MinimumPrice/MinPrice – (PA-API required) Filters search results to items with a price above the specified price. The value needs to be formatted in lowest currency denomination. For example, in the US marketplace, set 1234 for $12.34.
  • MinPercentageOff/MinSavingPercent – (PA-API required) Filters search results to items with a specified discount percentage. e.g. [amazon_auto_links search="shoes" MinSavingPercent=20] where 20 denotes 20 percent-off.
  • MinReviewsRating – (PA-API required) Filters search results to items with a customer rating above the specified value. Accepts a positive integer from 2 to 5. e.g. [amazon_auto_links search="shoes" MinReviewsRating=4] for products with a rating above 4.
  • CurrencyOfPreference – (PA-API required) Preferred currency. For accepted values, see the locale reference.
  • LanguagesOfPreference – (PA-API required) Preferred language specified in the ISO 639 language code. For accepted values, see the locale reference.

The id, asin and search arguments cannot be used together.

These shortcode argument names are case-insensitive, meaning maxprice is also accepted for MaxPrice.

Optionally, the following arguments may be set.

  • country – (string) the locale of the store. Accepted values are CA, CN, FR, DE, IT, JP, UK, ES, US, IN, BR, MX, AU, TR, AE, SG, SE, and NL.
  • associate_id – (string) the Amazon Associates ID for the affiliate.
  • count – (integer) determines how many items should be displayed.
  • image_size – (integer) the image size in pixels.
  • title_length – (integer) the maximum title character length. Set -1 for no limit. Default: -1.
  • description_length – (integer) the maximum description character length. Set -1 for no limit. Default: 250.
  • link_style – (integer) the link style. Accepted values are 1, 2, 3, 4, and 5. Default: 1.
    • 1 – http://www.amazon.[domain-suffix]/[product-name]/dp/[asin]/ref=[…]?tag=[associate-id]
    • 2 – http://www.amazon.[domain-suffix]/exec/obidos/ASIN/[asin]/[associate-id]/ref=[…]
    • 3 – http://www.amazon.[domain-suffix]/gp/product/[asin]/?tag=[associate-id]&ref=[…]
    • 4 – http://www.amazon.[domain-suffix]/dp/ASIN/[asin]/ref=[…]?tag=[associate-id]
    • 5 – http://localhost/wp47?productlink=[asin]&locale=[…]&tag=[associate-id]
  • credit_link – (integer|boolean) whether to show the credit link. 1/true to show, 0/false to hide.
  • subimage_size – (integer) the sub-image size in pixels. Default: 100.
  • subimage_max_count – (integer) the maximum number of sub-images to display.
  • customer_review_max_count – (integer) the maximum number of customer reviews.
  • show_now_retrieving_message – (boolean|integer) whether to show the “Now retrieving…” message when sub-elements are pending to be fetched. true/1 to show false/0 to hide.
  • button_type – (integer) The type of buttons. The following values are accepted. Default: 1.
    • 0 – Link to the product page.
    • 1 – Add to cart.
  • load_with_javascript – [3.6.0+] (boolean|integer) whether to load the unit with JavaScript. true/1 to yes, false/0 to no.
  • product_title – [4.0.0+] (string) An alternative text to alter the product title for anchor text. This is only supported when the asin argument is set.
  • show_errors – [4.1.0+] (integer) Whether to show the output error. Default: 2.
    • 0: do not show error.
    • 1: show the error.
    • 2: show the error in an HTML comment.

These values can be pre-defined from the setting page via Dashboard -> Auto Amazon Links -> Settings -> Default.
If these arguments are omitted, the values set on the setting page will be used.

Shortcode to Display Buttons

Although the %button% tag in the Item Format unit option allows you to insert a button, the button can be displayed independently with the shortcode, [aal_button ...].

It accepts the following parameters.

  • asin – (required, string) Comma delimited ASINs.
  • type – (optional, integer) 0: Link to the product page, 1: Add to cart button. Default: 1.
  • id – (optional, integer) The button ID. To use the button created via Dashboard -> Auto Amazon Links -> Manage Buttons, specify the button ID.
  • quantity – (optional, integer) The quantity of the item to add to cart. When multiple ASINs are specified, separate the values by commas.
  • country – (optional, string) The locale of the marketplace. If not set, the default value set in the Default setting tab will be applied.
  • associate_id – (optional, string) The associate tag. If not set, the default value set in the Default setting tab will be applied.
  • access_key – (optional, string) The public PA-API key. If not set, the default value set in the Associates tab will be applied.
  • label – (optional, string) The button label. e.g. ‘Buy Now’. Default: Buy Now.
  • offer_listing_id – (optional, scalar) An offer listing id that Amazon gives.

Creating Your Own Template

Download the zip file from the example templates repository. Make sure it runs as a plugin and a few example templates are loaded in the template listing screen (Dashboard -> Auto Amazon Links -> Templates).

Follow the steps described in readme.md of the linked repository and start modifying them. You want to:
– rename the root directory, amazon-auto-links-example-templates
– rename the template directory names, lightslider and minimal
– rename the main plugin file name, amazon-auto-links-example-templates.php
– rename PHP namespaces, AutoAmazonLinks\Templates\Examples
– replace screenshot.jpg in the template directory
– replace the header comment of style.css in the template directory
– modify CSS rules of style.css

Obtaining PA-API Access Key and Secret Key

To display more detailed product information, PA-API is required. A pair of access and secret key is required to perform API requests.

To get the keys,

  1. login to Amazon Associates of your locale.
  2. From the navigation menu at the top, navigate to Tools -> Product Advertising API.
  3. If you haven’t used it before, press the Join button. An access and a secret key should be issued and displayed after that.

You can check if your keys are valid with Scratchpad.


Screenshots
FAQ
ChangeLog