Amazon Search Widget

The Amazon Search Widget enables you to display an inline Amazon Search into your website. This widget allows the user to do a keyword search of your selected SearchIndex (e.g. Books), in addition to defaulting to your pre-selected search term.


Amazon Search ShortCode

The Amazon Search Widget can be inserted into your website’s posts and comments through the use of the amazon_search ShortCode.

[amazon_search default_search_term="Wheel of Time" search_index="Books" columns="1" rows="5"]

The ShortCode interface fully supports all widget options that are defined in the properties section.

Amazon Widget PHP API

When developing the plugin we felt that it was necessary to enable users full flexibility in where they want to place the Amazon Widgets. For this purpose the AmazonWidget class was created that exposes the static Search method that can be used to output the Amazon Search Widget within the php code of your WordPress Theme. The Search method like all methods in the API take an associated array of supported properties as it’s only value. To make things easier it allows you to use either the Amazon or ShortCode name of the property.

AmazonWidget::Search( array( "defaultSearchTerm" => "Mistborn", "searchIndex" => "Books" ) );

Amazon Search Properties

The below information is sourced from Amazon’s Widget Source web page with a few modifications for ease of use and inclusion of ShortCode references.

Common Properties

Parameter ShortCode Description
tag tag Your Associate id
width width Widget width in pixels
columns columns The number of columns to be displayed in the search results
rows rows The number of rowsto be displayed in the search results
defaultSearchTerm default_search_term The default search phrase used when the widget is first displayed
searchIndex search_index Use this parameter to restrict the user’s search to a specific Amazon category. Learn More
What is a Search Index?
showImage show_image Set to True if you want the widget to display product images
showPrice show_price Set to True if you want the widget to show the product price
showRating show_rating Set to True if you want the widget to display product ratings

Widget Designs

[SC] design
[SC] color_theme
1 Blues
Parameter Values
[SC] outer_background_color
Any hex color value (i.e. #CC6600)
[SC] inner_background_color
[SC] header_text_color
[SC] linked_text_color
[SC] body_text_color
[SC] rounded_corners
True, False
2 Default
Parameter Values
[SC] outer_background_color
Any hex color value (i.e. #CC6600)
[SC] background_color
[SC] border_color
[SC] header_text_color
[SC] linked_text_color
[SC] body_text_color
3 Cinnamon
Parameter Values
[SC] header_text_color
Any hex color value (i.e. #CC6600)
[SC] linked_text_color
[SC] body_text_color
4 Onyx
Parameter Values
[SC] header_text_color
Any hex color value (i.e. #CC6600)
[SC] linked_text_color
[SC] body_text_color
5 BrushedSteel
Parameter Values
[SC] header_text_color
Any hex color value (i.e. #CC6600)
[SC] linked_text_color
[SC] body_text_color

Want to display the Amazon My Favorites Widget on your website? Then install the WP Amazon Associate plugin today by downloading the plugin or installing through your WordPress Plugins Admin Panel.

Comments & Questions

  1. I would like to use the search widget but the Amazon links that are outputted are all dofollow.

    (It’s the same when I get the widget code directly from Amazon.)

    How do I make them nofollow?

  2. I think your plugin is excellent just can’t figure out the height issue in the widgets. I’ve been looking for it for a bit know and figured I’d just ask if you know where the issue may be.

    1. James:

      Can you please elaborate on the issue you are having with the widgets’ height? I took a look at your website and the widgets are displaying correctly for me when viewed in IE8, Safari, Chrome, and Firefox. Sending an email to containing a screenshot would make it easier for me to resolve.

      > Matthew

      1. Sorry issue was in the theme.

  3. Matt, great plug-in you have here and I want to thank you for putting the time and effort into making it what it is. My question is a general one. After installing and fullying completeing the setting settings, I was excited to see that your widigets, in wordpress, work excatly like all the other widgets in the way I can drag and drop them to the sidebar. Quick, easy, and intuitive. I’m trying to add the Amazon Search widget. The probelm is that when I click save in wordpress and then visit my site, I only see the widget title in the sidebar of my page and not the actual search dilogue and amazon products. I’ve tried all the other widgets as well and I keep getting the same result, just the title of my widget and not the actual widget. anything you can think of to help me out?

    1. Nate do you have any ad blocking software enabled on your browser? Amazon widgets tend to get blocked by them. Also if you send me your website address I can take a look to see if there could be any other reason for the widgets to not display.

      > Matthew

      1. Matthew, seems to be showing up fine on google chrome. I’m using IE 8 on my other comp. both PC. I’m guessing it’s showing up fine you too. thanks again!

        1. Nate the Search Widget is functioning as expected for me. Best of luck with your site!

  4. Hi Mathew
    My widget has not got a Tag Parameter in the properties for me to input my Associates ID as displayed above is there something to do
    I have updated and save settings


    1. Dom:

      The TAG property of all widgets and links are inserted automatically from the plugin. In the Settings page of the plugin you insert your Associate IDs for the diferent Amazon Locations. The plugin will insert these values into widgets and links as required so that you get full credit for qualified links and sales from Amazon. This way if you ever change your Associate ID you don’t need to modify any code/content of your website.

      Matthew J. Denton

  5. Hi Matthew,

    (sorry for double posting, but my email was mis-spelled.)

    I like the amazon widgets very much – especially the localization. But there is a flaw in the search and carousel widget: Amazon Europe has in Italy, France, and Germany besides the search category “books” a category like “foreign books”; whereas “books” only shows books in the respective language, “foreign books” shows in addition e.g. for Italy books in German, English and French.
    These additional category is not available for the widgets.


    1. Michael, thanks for bringing this to my attention I will review and see about getting it included.

  6. Hi,

    Same question as above.

    I would like the “Amazon Search Widget” to default to the current page’s Title, but have no idea how to do this 🙁

    The above doesn’t work for me.

    Any more ideas?



  7. This widget is looking funny. The “page numbers” are displayed vertically instead of hortizontally–please help!

    1. Website is:

    2. Debbie:

      I looked at your site and there are some css conflicts. Amazon utilizes the id “nav” in it’s rendered css. You also utilize #nav in your style.css which is causing the navigation to display vertically. To correct you will need to update your theme, I would suggest simply changing your “nav” element and css to nav-site or similar and you should be all set.

  8. Hello,
    Thank You for the quick reply. I am not so good at php, but still I will check it out.
    Thank you once again!!!

  9. correction of file path for my previous post
    the full path of file is

  10. Hello,
    Your plugin is really great.
    But one thing i am missing here is that i want to use auto-search according to post category or post tags.

    i tried changing following code in the file wordpress-amazon-associateWidgetAmazon
    $instance[‘defaultSearchTerm’] = strip_tags($new_instance[‘defaultSearchTerm’]);

    replaced the_tags(); with strip_tags($new_instance[‘defaultSearchTerm’]);
    but not working.
    any suggestion ?
    Thank You.

    1. Also you will want to modify the defaultSearchTerm in the widget function as that is the code that gets executed on page rendering.

Add Your Comment