Amazon Machine Tags Plugin for WordPress

The forthcoming API change requiring signed requests will effect this plugin. If you do not update the plugin then it will stop working on August 15th. Comments on this version are closed, please comment on the update page.

In this article


I always wanted to implement one thing since I started the blog: a simple inclusion of Amazon items. I didn’t want to search through results that existing plugins provided. When I wrote about something like a book, I already used machine tags to identify the subject! So I found the inspiration to write my first real WordPress plugin: Amazon Machine Tags.

Here’s what it does:

  1. It identifies any tag in the machine (or triple) tag form book:isbn=1234567890 or amazon:asin=1234567890. That works with native tags from WordPress 2.3 and later, Bunny’s Technorati Tags, Jerome’s Keywords, or as inline text (see below).
  2. Then it gets the item information and a thumbnail image from the Amazon Web Services API. That’s the real thing including prices and such, no cheap RSS feed. ;)
  3. The item(s) are displayed in the sidebar or in a blog article with a link to the visitor’s best match (if the ip2country plugin is installed) or a default Amazon shop of your choice. See examples in the sidebar.

    The “best match” is based on the visitor’s location. If she is from one of the six countries where Amazon has shops, that locale is chosen. If he is from Europe, the preferred language is matched to either France, Germany, or UK, with UK as default. If it’s neither a locale nor Europe, is the default. Based on your location, do you think that’s a reasonable approach?

    Note that some items, like books in any language other than English, are only available from certain locales, so a visitor from the UK might not see German books you recommend.

  4. If you are an Amazon Associate for that locale, your Associate ID is included automatically.

You can edit the server-side, semantic and valid XHTML output via XSLT, change the CSS, or translate the admin interface through .po files. Actually Amazon loads the XSLT file from your server and processes it on theirs, so you shouldn’t block HTTP access to the plugin directory, and localhost doesn’t work either.

Results can be cached for anything between one second and one hour, so you don’t need to worry even when you run an extremely popular blog.

The YUI Connection Manager is included to verify the Access Key in the admin interface via REST and unobtrusive AJAX.

I hope this little piece of software serves you well and you like it.


  1. Get the latest version of the plugin from the WordPress site.
  2. Upload the whole amazon-machine-tags folder into the /wp-content/plugins/ directory.
  3. Activate the plugin through the “Plugins” menu in WordPress.
  4. Get an Amazon Web Services Access Key.
  5. Create a wp-content/cache/ directory with permissions set to 755, or 777 if you create the directory as root user.
  6. Put <?php AMTAP::get_items(); ?> in your sidebar and start using machine tags.
  7. Edit amtap-blog.css if you like.
  8. If you want to use tags in a blog article, write [amtap book:isbn=1234567890] or [amtap amazon:asin=1234567890]. Thanks to paulinepauline for that idea.

Frequently Asked Questions

Does it work in the sidebar on Pages, too?

Posts have tags, pages don’t, so it doesn’t work on those by default. But there’s a plugin called tags4page that enables tags for pages. Works like a charm.

Is there a limit of how many items can be requested?

Yes, Amazon has a limit of 10 items per request. Since they are separate requests, you can use a maximum of 10 items in the content plus a maximum of 10 in the sidebar.

Would it be possible to cache the images?

Technically it wouldn’t be a problem, but the Amazon Web Services license explicitly forbids caching of images (see 5.1.10). Sorry.

I need to a larger thumbnail (medium), but can’t seem to find a place to edit the size of the image being requested.

The image size can be edited in the XSLT. The original result is a XML file that is transformed by Amazon using your local copy of amtap-html-sidebar.xsl and amtap-html-content.xsl, respectively. Replacing every occurance of .//aws:TinyImage with .//aws:MediumImage should do the trick.

You can view the original XML when you activate the “debug” option in the admin interface so that the request string is printed as a comment in the sidebar’s source code. XSLT is a very powerful tool, and there’s a lot more in the XML, for example customer reviews.

Are all options really required?

No. The only required field is the Amazon Web Services Access Key. You can leave the others, they are set to defaults then.


  • 3.0 (2009-07-31): Added signed requests for the new Amazon authorization requirement. Updated the API version to 2009-07-01 (please note: if you use your own XSL files, you must update the version in the XML namespace URL). Updated links.
  • 2.0 (2008-07-18):
    1. Added fields for editing the sidebar headline, link target, and displaying rating stars.
    2. Added an error message if the plugin is run from a private IP address space like localhost.
    3. Changed priorities for price selection, they are now: LowestNewPrice, ListPrice, first offer, LowestUsedPrice.
    4. Added support for the display of an artist name.
    5. Added rating stars.
    6. Fixed EAN numbers with a dash.
    7. Fixed cutting of titles after a period.
    8. Changed CSS and XSL files. Take care when you edited those.
  • 1.1.3: Changed amtap-admin.css and to make the admin interface look prettier with WordPress 2.5.
  • 1.1.2: Fixed a bug in amtap.php when there are no other tags but default tags.
  • 1.1.1: Fixed the sort order of inline items, a bug for returning an error message when the cache file is not writable, and added Amazon’s limit of 10 items per request.
  • 1.1.0: Fixed the display of inline tags on the home page. Improved regular expression for filtering inline tags.
  • 1.0.6: Fixed a bug introduced through the new default items function when there were no items to be displayed in the sidebar.
  • 1.0.5: Added an option for default items on every page. Changed amtap-html-sidebar.xsl to sort items in the order of the request.
  • 1.0.4: Bugfix for replacement of dollar characters in content. Also content items are now cached separately.
  • 1.0.3: Fixed the display of inline tags on category pages.
  • 1.0.2: Changed the plugin path from amtap to amazon-machine-tags for consistency with the file structure in the zipped file.
  • 1.0.1: Bugfix for native WordPress tags.

202 Responses to ‘Amazon Machine Tags Plugin for WordPress’

  1. Martin Kliehm

    John, I assume you put <?php AMTAP::get_items(); ?> somewhere in sidebar.php, and it is not a CSS problem, i.e. when you view the source code there’s no trace of any code from the plugin, right?

    Probably you just didn’t use (machine) tags then. To display items in the content you need to add them manually, but for the sidebar inclusion you just tag the post. There’s a field “Tags” below the textarea where your post content goes, and there you write book:isbn=1234567890, as many tags as you like. Either comma separated (WordPress 2.3 tags or Jerome’s Keywords) or space separated (Bunny’s Technorati Tags). So you don’t need to pass arguments to get_items() as the function pulls everything from the existing tags of the post.

  2. John Chastain

    Please excuse me if the answer to this question is obvious. I can’t seem to figure out how to get amazon items to appear in the sidebar of my wordpress blog. I can however get them to appear in the content section. Perhaps I don’t have a grasp of the syntax required to add tag code to the sidebar.php or perhaps the list of books to be displayed in the sidebar should be setup elsewhere. Would it be possible to provide a few more clues on how to setup the sidebar / how to pass the machine tags as arguments to get_items() or where to setup a listing of amazon items for sidebar inclusion? Thanks for your patience, I am a bit of a wordpress newbie.

  3. John Chastain

    Ok, that makes a lot of sense…. Can “tags” be added to the sidebar of wordpress Pages (instead of just posts) using custom fields? Again, please excuse my limited knowledge of all things wordpress related.

  4. Martin Kliehm

    Ah, I see the problem: there are no tags on Pages. A custom field like “tags” could do the job indeed, but there is no function to pull them out yet. It shouldn’t be too difficult though, I can build it into the next version. Give me a week or two. ;)

  5. John Chastain

    Thanks so much for your quick responses! I just found this plugin which seems to work in conjunction with Amazon Machine Tags: tags4page.

    It might provide some more inspiration for the whole “tags on Pages” idea. Thanks again!

  6. Martin Kliehm

    Cool, that’s even better, thanks for the research! I just added this to the FAQ.

  7. Tori

    Can I get the amtap info to show up in the “categories template” as well, or does it only work for a single post?

  8. Bob Clifford

    Hi Martin,

    I need to a larger thumbnail (medium), but can’t seem to find a place to edit the size of the image being requested.

    Thanks for your help,


  9. Martin Kliehm

    Tori: During development the info showed up everywhere in the sidebar, but I switched that off. In the sidebar the function cannot be embedded in the Loop, so I had to use $post to get the tags. In categories, search results, or the start page $post represents the latest post, but it is irritating to see seemingly unrelated book recommendations in such a list.

    Bob: The image size can be edited in the XSLT. The original result is a XML file that is transformed by Amazon using your local copy of amtap-html-sidebar.xsl and amtap-html-content.xsl, respectively. Replacing every occurance of .//aws:TinyImage with .//aws:MediumImage in lines 49-56 should do the trick.

    You can view the original XML when you activate the “debug” option in the admin interface so that the request string is printed as a comment in the sidebar’s source code. XSLT is a very powerful tool, and there’s a lot more in the XML, for example customer reviews.

  10. Martin Kliehm

    Tori: Thanks for the hint. It didn’t come to my attention before because in my own blog only excerpts are shown on category pages, search, archive, and home. I fixed that bug now, please download version 1.0.3 for the fix and don’t hesitate to give feedback.

  11. Tori

    Martin, Thank you for your comments. My question is a little different. I am using the [amtap…] method in the post itself, but it only displays on a single post. Is there anyway to get it to display when the post is shown among a group of posts as it is in the Categories template? I understand the limitations of the sidebar…

    You can see what I mean here: none of the amazon code displays… but in the single post it does…

  12. Tori

    you are amazing! Thanks…Now I just have one more question: do you have any idea why the full price is not showing up when the amtap tag is used in a post? (It shows up fine on the sidebar)

  13. Martin Kliehm

    Tori, I wish I had had beta testers like you. Interesting, the dollar characters got eaten by the WordPress text editor. You see, they are returned fine, but then they are “pasted” into the post and a lot of WordPress filters run and do their job. Like cutting anything that looks like PHP variables, i.e. strings with a dollar character in front of them. Now I’m replacing them with their numerical HTML entity, and everything works fine. See version 1.0.4. I didn’t test it before in the content with as default locale, and it worked with euro characters, of course. ;)

  14. Martin Kliehm

    Tori, it’s a new toy, so I’m still keen about it. Anyway, there’s a checkbox in the options for exactly that purpose, but it’s opt-in, and it only makes sense when the plugin is used in combination with ip2country, i.e. when more than the default locale is ever displayed …

  15. Tori

    I cannot believe how responsive you are! email me with your amazon id code so that i can put it in the blanks (or will it do that automatically?).

  16. Asoko

    Hi !

    This a great plugin, thanks. I’m experimenting right now, and it’s just too easy comparing to the “traditional” way. Inserting those links manually is such a complete waste of time.

    But… I see there’s a little lag when pictures are loaded and that they’re not cached (I presume). Do you think it’s possible to cache the pictures too ?

  17. Martin Kliehm

    Asoko: Thanks for the compliments. Technically it wouldn’t be a problem, but the Amazon Web Services license explicitly forbids caching of images (see 5.1.10). Sorry.

  18. Asoko

    Thanks, anyway :)

  19. Maurice


    I’ve read the instructions and I’m still having trouble getting the items to show up.

    I’m supposed to enter the text exactly like this: amazon:asin=######### , into the “Tags” of whatever post I want the images displayed on, and then the amazon listings are supposed to show up in the sidebar? Am I getting this right? When I do it, no items appear anywhere.

    I added the php code into the sidebar as instructed, what am I doing wrong?

  20. Jarod

    Hi! I couldn’t get the plugin to work on my blog. I’m using 2.3.1. Nothing shows up where I put the tags. Is it my theme or I did I miss out something?

  21. Martin Kliehm

    Maurice, Jarod: Right, that’s how it’s supposed to work. Could you please check the “debug” checkbox at the bottom of the admin page and send me a link to a post where you use the tags? I suppose both of you use native WordPress 2.3.1 tags and have set as default locale? Jarod, are you trying to implement it in the content or the sidebar?

  22. Monika

    Hi I’m using the new wp cache plugin — this requires also a wp-content/cache folder. Use your plugin and this the same? Or is there any conflict between this two? Thanks a lot

    Hi das neue wp-cache Plugin mag auch einen Ordner unter wp-content/cache. Vertragen sich Dein Plugin und dieses? Wie agiert Deines, wenn ich dort den Cache mal lösche. Irritierte mich ein wenig. Monika

  23. Martin Kliehm

    Monika: The cache folder is shared between many plugins for caching, that’s why I chose it. ;) Don’t worry, there is no conflict. You can delete the files in the cache folder, and as long as the folder still exists, the plugin will simply write new files into it. However, if there is no cache folder while the plugin is still active, you will probably get a PHP error.

  24. Miha Jenko

    Hi, first I want to express my gratitude for this wonderful plugin, second, I have a feature request: Can the [amtap ...] enclosures get another tag that would specify the desired locale for an item not offered on the default locale? For example [amtap locale:us amazon:asin=13436787], so that the plugin would fetch the information from the U.S. Amazon instead of Japan’s if I had my default locale set to Japan. I have a blog that links to products from both and, so this would be a fairly useful feature for people in my position.

    Thank you again for your enthusiasm and time!

  25. Tori

    Martin, I love your plugin and have it working really well on a couple of sites. All of a sudden, however, it will not validate my AWS key on a new site. Any ideas why that would be. I’ve quadruple checked it and even gotten a new one for a different user, but it will not validate… Meanwhile I am having no problems on other sites. One question: the sites I am having problems with do not have designated ip servers. Could this pose a problem?


  26. Hendry Lee

    Thanks for such a great plugin.

    Quick question: Can I display a set of “default” products in the sidebar? Can I display products on the homepage of the blog, which consists of summaries of my recent 5 posts?

    Thank you again for your time.


  27. Martin Kliehm

    Miha: Thanks for the inspiration, that would be a challenge. However, so far the plugin needs only one API request and it’s fairly easy to replace the inline tags with the result’s HTML using a regular expression. With the locale parameter there would be at least two requests, and I couldn’t just merge the two results because the items would be in the wrong order. I’d rather keep it in mind until I come up with an elegant solution.

    Tori: There shouldn’t be a problem with one Access Key across multiple domains as long as there isn’t more than one request per second with that key. I tested the plugin on at least three domains on different servers with the same key without any difficulties. I can only guess, but there could be a problem because the API needs to access the XSLT file. If the file is inaccessible due to a failed DNS lookup, the result would be a failed validation. The plugin has an error message for a failed connection to the Amazon Web Service, but I don’t think Amazon provides distinguished error messages when they are unable to retrieve the XSLT file.

    Hendry: Good idea. I can imagine that book authors in particular would like to display a default list of their books on every page. I will include it in the next update. Download version 1.0.6 to get an update with that feature. It can be set in the options.

  28. Martin Kliehm

    shadaik: Interesting, doesn’t have an access interface, and the page just redirects to but keeps as the logo. So I wonder what the difference between two products would be? Does the uncut (Austrian) version have a different ASIN or EAN? Would it be possible to simply refer to the two ASINs then?

  29. shadaik

    Nice plugin, however I miss (Austria) support. I always missed a way to display links to both austrian and german shop simultaneously when adding manually, so this would really help.

    The difference might be miniscule, but for a blog dealing with videogames (often cut in Germany, but uncut in Austria) this can be important.

  30. Tori

    Thanks, I think I know what the problem is and can solve it now.

  31. shadaik

    Oh, I didn’t check, just got to and saw that it seemed to be a service on its own. The uncut comment was based on the fact that this is a standard difference between Germany and Austria, however with there seems to merely be a cosmetical distinction. So nevermind my silliness. ;-)

  32. Dieter Welzel » Blitzblank-Theme und das PlugIn Amazone Machine Tags

    […] PlugIn Amazone Machine Tags habe ich erstmalig mit meinem Beitrag Buchtipps zum Erstellen von Webseiten eingesetzt. Dem war […]

  33. Hendry Lee

    All I can say is WOW….

    I put down the idea for weeks thinking that it would not be added to the plugin. How wrong I was about it.

    Now I am really a happy user of this plugin.

    Thanks again Martin.

  34. Dieter Welzel » Buchtipps zum Erstellen von Webseiten

    […] und ich ihn selbst nicht ändern kann. Er wird vielmehr automatisch mittels des WordPress-PlugIns Amazone Machine Tags erzeugt. […]

  35. tom

    Hi Martin,

    I tried for an hour to get this plugin to work. Is it possible I am missing a hook in my theme? Here is the debug info I get. Any help is greatly appreciated. Looks like a really cool plugin.

    AWS.InvalidOperationParameterThe Operation parameter is invalid. Please modify the Operation parameter and retry. Valid values for the Operation parameter include TagLookup, ListLookup, CartGet, SellerListingLookup, CustomerContentLookup, ItemLookup, SimilarityLookup, SellerLookup, ItemSearch, VehiclePartLookup, BrowseNodeLookup, CartModify, ListSearch, CartClear, VehiclePartSearch, CustomerContentSearch, CartCreate, TransactionLookup, VehicleSearch, SellerListingSearch, CartAdd, Help.

  36. djbaxter

    I had version 1.04 working nicely on my blog (WP version 2.32).

    Upgraded to 1.06 and it stopped displaying anything – no book image, no links, nothing.

    Re-installed version 1.04 and it’s working fine again.

    Something’s amiss in the latest version…

  37. Carsten Knoch

    Hi – I installed version 1.06, upgrading from 1.04. It seems that there’s a problem with the new version. I use the plugin to refer to items inside my posts, not in the sidebar. In version 1.06, my homepage/rollup page now no longer shows the items inside the posts… if you click to the actual post itself, the item appears, but not in posts displayed on the homepage. I’ve rolled back to version 1.04 and all is well again. Can you address this issue? Thanks and keep up the good work! :)

  38. John Kubala

    Martin, Thank you for such a useful plugin! I’ve just got one question that will probably very obvious. Where can I change the text size for the title of items? On my website, the title of the book or DVD is almost as large as the title for the blog article and I’d like it a little smaller. Is there a way that the font size can be set as an option? or can you point me to the place in the code that I need to change this option? Thanks in advance! John Kubala

  39. Martin Kliehm

    tom: The plugin uses two ways to send requests to Amazon: ItemLookup and Help. Both are hardcoded, so I don’t quite understand how the error could occur. Does it occur in the admin section or in posts? Could you please check the debug option in the plugin’s admin settings and send me the link?

    djbaxter, Carsten: Sorry for the inconvenience, that bug was introduced with the new default items functionality. Also when upgrading it would be a good idea do delete the contents of the cache folder. Inline tags on the home, category, search, or archive pages should work again now. Reminder to self: check changes on the home page, too.

    John: The font size can be edited in the CSS, of course. Either you can edit it in plugins/amazon-machine-tags/css/amtap-blog.css, or a better place would be in your own CSS so you don’t overwrite anything when a new plugin version is released.

  40. Nichole

    Hi, Martin! Thank you for the great plugin. Could you tell me specifically what part of amtap-blog.css needs to be edited to alter the font size?

  41. Martin Kliehm

    Nichole, John: editing the font-size is quite easy. First let me show you the HTML structure so that you can better understand to which elements the CSS refers to: Basically there is a container element, in the sidebar with the id="amtap", or inline in a post with class="amtap-item". Therein is among other elements a headline h3 with the title, and the item description within a paragraph p.

    In short, in Cascading Style Sheets (CSS) IDs are represented by a preceding hash #, classes with a dot. So #amtap li h3 selects all h3 headlines that are within a list item within an element that has the ID amtap. Also — like the name suggests — there is a cascade of importance in CSS selectors. More specific selectors take precedence. So #amtap li h3 is more important than #amtap h3. If both selectors are equally important, the latest definition overwrites earlier ones.

    To change the font size you need something like this, either in amtap-blog.css or better in your theme’s style.css:

    1. #amtap li h3 {
    2. font-size: 1.0em
    3. }
    4. div.amtap-item h3 {
    5. font-size: 0.9em
    6. }
    7. #amtap li p, div.amtap-item p {
    8. font-size: 0.8em
    9. }
  42. John Kubala

    Martin, Thanks for that detailed explanation! Keep up the great work!

    John Kubala

  43. karl

    hi martin and thank you for the plugin, I try to get this working since some days now on: in the sidebar, but never was succesfull so far. you can only see the header of the sidebar module (“am lesestapel”). this site runs K2 as the background theme, and I use a K2 sidebar module for your PHP tag (a PHP module, of course..–))) the site also uses Ultimate Tag Warrior tags with links to Technorati, so I suppose the tags of the posts would anyway not work with your plugin (as you want standard 2.3 tags). however, not even adding a simple ISBN to the permament field in the plugin optino page shows any content. I thought I coule use your plugin with this “permanent” list only, and change the links to the books in this list. The Amazon Key verification worksm everything is “green” on the options page.

    Thank you for any thoughts, greetings from vienna, austria, karl.

  44. Martin Kliehm

    Hi Karl, during development I tested the plugin with earlier versions and UTW, and it didn’t work either. I forgot the exact reason, but there was something fundamentally different in core functions pre and after version 2.3. So it’s not a question where the tags are, but how well the plugin functions play with WordPress core functions. I would suggest to update to WordPress 2.3. That takes perhaps half an hour, not days… ;)

  45. karl

    Martin, thank you for the reply. I just see now that your plugin needs WP 2.3, sorry for the oversight, the page where I try to install it is on 2.2.1…

    Talking about migration: it is not so easy in this case, as the Blog author put a LOT of effort in the Tagging thing, and asks me to preserve all his UTW and Technorati TAG functionality after the upgrade to 2.3. I have not found all the mechanisms yet to replicate the WP2.2.1+UTW behaviour with WP2.3, thats my problem (but not yours, of course…-)))) I will check back once I upgraded to 2.3, thank you, karl.

  46. Martin Kliehm

    Carsten, probably you mean inline tags, not the order of items in the sidebar, right? In the sidebar the order is exactly like in the post’s tags. Since the tags are sorted alphabetically by WordPress, this is reflected in the sidebar as well and cannot be changed. The new default tags are rendered before any post-specific tags though.

    Inline tags within the content should be in the right order. At least they were when I tested them, but since you report a random sort order, it could be possible Amazon returns the data randomly and my correct order was just a coincidence. I will have a closer look at that this week. How many inline items would you suggest for testing?

  47. Carsten Knoch

    Hi Martin,

    I think I’ve discovered another issue with the plugin. This has been an issue for the last 2-3 versions. It’s about order of items when using it in a post. Let’s say I write a post where I refer to one CD (ASIN) from Amazon at the beginning, then I have a bunch of text, and then I refer to another CD. It seems that the plugin randomly renders which CD appears in which position. The second CD may appear in the first slot, and – when I reload the page – it changes around again. It’s a little confusing, especially if you’re writing reviews and trying to refer to items in particular ‘slots’. Can you take a look at that, or give me some perspective? Thanks!

  48. Carsten Knoch

    You could use as few as 2 — and maybe put some “regular” text in between them. Then, reload the page a few times.

  49. Martin Kliehm

    Peter: so far there are 3 ways to insert tags:

    1. In the sidebar: When you mention an item in a post, but don’t want to interrupt the text flow in the article. Enter comma separated machine tags in the post form, just below the textarea where the content is entered.
    2. In the sidebar as default: If you want items displayed on every page of your blog, enter comma separated tags on the plugin’s admin page. That can be found under Options – Amazon Tags in the admin interface.
    3. Within the text content: Just write [amtap book:isbn=1234567890] or [amtap amazon:asin=1234567890] in the text field.

    The Access Key can be entered in the options as well (/wp-admin/options-general.php?page=amtap). There’s also a link to the options on the page where you activate the plugin. ;)

  50. Peter

    Hi Martin I am totally new to blogging. My website is almost ready for regular posting. My reseach indicated that you have an excellent tool for displaying Amazon products. Do you have a reference where I can learn how to insert tags? I have completed the first 5 steps of your installation instructions and 6 I will manage as well. I just don’t know how to use the machine tags. (the process)

    Is this all done by using the write editor or does one need to use HTML tags and programming to implement this? I know this is very basic, but I will appreciate assistance.

  51. rob

    Hi Martin,

    I am having some trouble installing version 1.1.0 on my site (wordpress version 2.3.1) I have created the /wp-content/cache directory with permissions 755 as instructed, but when I try to update options, I get the following error.

    Warning: fopen([…]/wp-content/cache/amtap-aws-key-verification.txt) [function.fopen]: failed to open stream: Permission denied in […]/wp-content/plugins/amazon-machine-tags/amtap.php on line 332

    I have checked the cache directory and it is empty. Any advise on how to proceed would be appreciated.


  52. Jan

    Hello Martin,

    your alternative way to fetch the XML doesn’t seem to work (at least in my case). The $sResult just contained “nocache”. After installing the Debian package php5-curl and restarting Apache2 the curl_init function could be found and the $sResult showed the correct result. The next problem is that I only see the book in my content if I echo the $sResult.

    Cheers, Jan

  53. Jan

    Solved! My fault, the cache directory was not writeable by the webserver. It correctly shows books using machine tags in my blog posts.

    I wanted to compile a list of books in my post but it looks like there’s a limitation? A few books is okay but if I have 10 books in my list the list is empty when rendering the page. Sometimes 6-7 books are shown but this could be influenced by some cached books.

    Do you know if it is possible to use another currency? I’d prefer to have the price in CHF instead of €.

  54. Dave

    I have the same problem as as Tori above. At the moment I am still in the testing stage so am running my installation on localhost. Could that be stopping the check to see if the Amazon code is valid? I am inputting the right code (I’m copy and pasting it from the Amazon website). Thanks.

  55. Martin Kliehm

    Rob, Jan: My fault, when advising to set permissions to 755, I assumed that the directory is created with the same rights as the web server. However, if you create the directory as root, permissions have to be 777.

    Dave: definitely. Amazon’s server must be able to access the XSL file on your server, and localhost can’t be reached from the web. ;)

  56. Dave

    Thanks very much for the prompt reply. I thought that was the case but, because Tori didn’t post their solution wanted to check :)

  57. Martin Kliehm

    Carsten: For some reason Amazon returns the items in random order. I added sorting to the content XSLT now, so that should be fixed. Please download version 1.1.1 for the patch.

    Rob, Jan: There was an error in my function to check if the cache directory is writable, I fixed that, too.

    Jan: Good point, there is indeed a limit of 10 items per request! I didn’t know that. Well, there has to be some limit… making several requests would be a possibility but somewhat complicated because of the one request per second rule. Can you live with Amazon’s 10 items?

    Also AWS doesn’t provide a method to convert currencies. But the European Central Bank offers daily currency conversion rates in XML! I’ll implement that in some future version to convert € to 34 other currencies, including Swiss francs. Like setting one currency as default in the options. Are there similar XML services for converting USD or GBP?

  58. matt

    “The access key you entered is invalid. Please double-check it.”

    I keep getting that error despite double and triple checking it. Even signing up for a new AWS account and using that number… Any idea why I’m getting that error?

  59. Martin Kliehm

    matt: I’ll check if there’s a chance to provide a more accurate error message. The one you reported pops up when the plugin doesn’t get a positive reply from Amazon. It turned out this is the case either because the key is invalid, or because the API returns another error. Other users have reported similar problems when the API was unable to connect to their server…

  60. matt


    Thanks for pointing out those comments — I somehow missed them earlier. I have the same problem as Dave, since I’m currently just testing on localhost.

    I’ll wait and see what happens when I test it on my server :) Thanks!

  61. wheatdogg

    Great plugin, but I’m having trouble with the display using inline tags. With the theme I use right now, the div for amtap-item is displayed after all the divs in the sidebar, so there is a huge whitespace between the end of my post and the amtap-items. Look here to see what I mean.

    How can I fix the code so that amtap-items are listed immediately below the post?

  62. Martin Kliehm

    wheatdogg, the inline item is displayed with this huge gap because the CSS class amtap-item uses clear: both. The reason is to clear any floating elements in the content so that the item images won’t overlap. This works fine as long as the content is also floated. That isn’t the case in your theme. There’s an easy way to fix it: just add the following to your theme’s style.css file:

    1. .storycontent div.amtap-item {
    2. clear: right;
    3. }

    If clear: right is still causing trouble, clear: none will fix it.

  63. wheatdogg

    Excellent! Thanks for the quick reply — clear: none worked like a charm.

  64. Hendry Lee


    I got this strange error message when I used default tags. It didn’t appear before, but only recently:

    Warning: array_merge() [function.array-merge]: Argument #2 is not an array in /path/to/wp-content/plugins/amazon-machine-tags/amtap.php on line 178

    Any ideas what’s wrong?

    Thanks for this great plugin!

  65. Martin Kliehm

    Hendry, thanks for the report. Argument #2 is not an array when a post doesn’t have machine tags. I didn’t think about that possibility when I inserted the default tags option. I fixed that now. Would you please download version 1.1.2 and confirm that the issue is solved?

  66. Hendry Lee


    Thanks Martin. That was fast.

  67. Dan Butcher

    Martin, Wonderful plugin! I have been lamenting the loss of wp-amazon, but your plugin actually works better.

    Question: is there a way to keep the plugin from pulling in the author, publisher, and price? I see that you’ve wrapped that info in the author class, so I could use css to hide it, but I thought you might have a better solution. My preference is to have only the image and title displayed.

    One more question/issue: The plugin works fine on my single post page; however, when I go to the home page, the image etc don’t show, and instead I get [amtap book:isbn=1590598032] showing. You can see the single post page and the home page (the problem post is the latest one).

  68. Martin Kliehm

    Dan, the easiest way to hide the author would be by CSS, indeed. More elegant is editing the XSL file. It is responsible for selecting some of the returned XML information and transforming it into HTML. However, since the XSL files are part of the plugin package you should pay extra attention not to overwrite your customized files when a new version is published.

    The issue with the missing text replacement on the home page sounds familiar from bug reports concerning version 1.0.6, alas I was unable to reproduce it with the current version (1.1.2). Either your version is out-of-date, or I need more enlightenment about any special circumstances how to reproduce the bug. ;)

  69. Martin Kliehm

    Dan, both plugins add a filter to the_content, but mine should be first because it has −10 as sort order. Anyway there are other ways to get excerpts. Either with custom excerpts and echo get_the_excerpt(), or with the_content( '(more…)' ). The latter places a “more” link (or whatever you prefer instead) when you write <--more--> in the post.

  70. Dan Butcher

    I found the culprit: the Homepage Excerpts plugin from; once I disabled it, the text replacement appeared on the index/home page. Your plugin is definitely the more valuable to me, so it’s good-bye Homepage Excerpts until I can figure out a work-around.

  71. Dan Butcher

    The value of the Homepage Excerpts plugin is that it would display a user-determined number of posts in full on the home page and then all others as excerpts — something it would have taken me a while to figure out how to do on my own. Fortunately, the Excerpt Editor plugin provides the same functionality (and others) but doesn’t interfere with Amazon Machine Tags. I’m going to let the Homepage Excerpts plugin creator know about the conflict.

  72. Lordi

    Hello Martin,

    i have same questions
    1.) how can i add target="_blank" to the links to Amazon? I don’t want a target="_self" link.

    2.) for future relaise
    i think it will be nice, when the customer “vote” will be displayed. (by option)

  73. Lordi

    i found a solution by my self for the “new Browser window”

    you have to enter the “amtap-html-content.xsl” or “amtap-html-sitebar”.xsl file and edit same xls comands.


    on my blog you will find the litle hot-wo.

    Tnx Martin for this great plugin.

  74. Amazon Machine Tags Links im neuen Fenster

    […] eine kleines how-to zum WP Plugin „Amazon Maschine Tags“ das es ermöglicht, dass die generierten Links in einem neuen Browser Fenster aufgehen, so […]

  75. Dan Butcher

    Does this plugin work only on full-text posts and not on excerpts? Is so, then I would need to make sure I create a custom excerpt that doesn’t contain the amtap code.

  76. Jonathon

    Unless a MySpace user changes the default setting, MySpace automagically links titles of books, movies, music and perhaps other things to purchase pages on (The $ commision goes to MySpace, not to the MySpace user.)

    Is there any way Amazon Machine Tags could work without us needing to look up the book:isbn=1234567890 or amazon:asin=1234567890 machine tag?

    Or as Janis Joplin sang: Oh Lord, won’t you by me a Mercedes Benz?

  77. Russ

    This is an awseome and simple plugin… Thanks! I’m trying to figure one thing out. The price is the list price. I’m trying to figure out how to list the actual purchase price. I want to have the price display something like this: List price $9.99 Our price $7.99. I think this will increase the clicks. Is this possible?

  78. Martin Kliehm

    Dan, that was a case I overlooked during testing, but should be easy to fix. I’ll implement it soon. Thanks for the hint.

    Jonathon, I’m afraid that would be too much. Of course the Amazon API could be used to search for words. But you can buy almost anything at Amazon, so everything would be linked. I must admit I have no idea what algorithm could be used to extract decent search terms from a text. Probably MySpace uses the other way round and takes the top 100 or 1000 titles of books, movies and music, and replaces these terms in a text. C’mon, how many titles do you blog about in one post! The elegance of this plugin is that you can specify exactly which item you want to be linked, especially when there are several editions of a book, or a CD and a vinyl version, or a DVD and video tape and BlueRay. There’s another plugin by somebody else making suggestions for the lazy authors, but I assume that takes longer than simply looking up an ISBN. ;)

  79. Dave

    I’ve installed the plugin on my live site now but, when I try to visit the options page it’s blank :( I can see the WordPress navigation but the last thing that is displayed is the Amazon Tags list entry. The HTML ends with:

    <li><a href='options-general.php?page=amtap' class="current">Amazon Tags</a></li> </ul>

    I’m using the latest version and it all works fine (bar the fact that I can’t get the Key to authenticate) on my localhost so I’m at a loss. I’ve checked permissions and, variously, set them to 755 and 777 but that doesn’t seem to make any difference :(

    Any help you can provide is gratefully received. Thanks.

  80. Martin Kliehm

    Ross, this can be done by editing the XSLT file (but beware not to overwrite changes with an update). Currently the list price is used if it is available. Otherwise the price of the first offer is displayed. If that is unavailable, the LowestUsedPrice is used.

    Ah, I see potential for improvement by taking the LowestNewPrice instead of the first offer. Do you reckon it would be better to display the LowestNewPrice with the LowestUsedPrice and then the list price as fallbacks?

    Dave, unfortunately I’m unable to reproduce that bug. But the plugin doesn’t write anything to a folder unless you save options. Apparently WordPress completely fails to include the options file. So my guess would be some incompatibility with either your WordPress version (do you use 2.3 or higher?) or an outdated PHP installation. The plugin itself is simply a PHP file with another PHP include. It seems your installation fails on that basic level.

  81. Dave

    I’m using WordPress version 2.3.3 on both the local version and the online version. Both have exactly the same set-up apart from the fact that the local version is hosted on a Windows XP Pro machine (using XAMPP as the server engine) while the online version is on a *nix box.

    Unfortunately it looks like I’ll have to give this, otherwise excellent, plugin a miss :(

  82. Martin Kliehm

    Dave, the plugin doesn’t work on localhost because Amazon must be able to access the XSL files to do the transformation. I chose their transformation service to prevent issues with incompatible local transformation engines. Still the options page should be displayable. With XAMPP you probably have a current PHP version. Strange that there isn’t any PHP warning at the break point … I’m off to SXSW for the next couple of days, but I can check the setup with XAMPP when I return, just because I’m curious.

  83. Dave

    I wouldn’t worry about it. I doubt the problem is with XAMPP as it works fine (aside from not being able to confirm the key because it’s a localhost). Perhaps it’s an issue with the version of PHP that’s running on the server.

  84. ecolopop

    Hi, can we use custom fields instead of tags ? tags are great but I use them in other areas, such as related posts, and the amazon’s tags keep popping up everywhere.

  85. Martin Kliehm

    ecolopop, I’m not sure if I understand your question. Amazon tags cannot pop up everywhere because they are in machine tag form, i.e. book:isbn=1234567890, and only accept amazon:asin, book:isbn, and book:ean as flags. I can’t imagine that you use this format anywhere else? This plugin uses the regular WordPress tags, so of course they are part of the normal editor interface as they belong to WordPress. ;)

  86. WP Plugin Review

    […] Amazon Machine Tags (version 1.1.2) WordPress Extend […]

  87. Thomas D.

    I think what ecoloop means is that plugins like Related Posts may count items as related if they share an amazon ASIN. I had this popping up every now and then in the first time when all titles I reviewd on the Wiis Virtual Console used the same amazon tag in order to link Wii points (a kind of virtual currency that is used to pay downloadable content on Wii). Also, they pop up in the tag clouds which so far is the main reason I don’t use a tag cloud.

    Anyways, I do have another question: Does amazon Machine Tags work under WP 2.5 ?

  88. Thomas D.

    Um meine Frage mal selbst zu beantworten: Jupp, läuft auch unter WordPress 2.5 vollkommen sauber.

  89. David Vincent

    Sorry, but tested on 3 sites with WP 2.3.3, no way to make it work in sidebar, what is the problem ? How can i fix it ? Thanks :)

  90. David Vincent

    Thx, the page is, hosted by HostGator. I have added a book on this page for test, it works, but I have also in the sidebar, but nothing shows up !!!

    mysql_connect is localhost… (can’t be changed).

    The other blogs are not public, if you send me a mail, I can give you the URLs Also I can’t import the iptocountry to the database, do you have a script for it ? Thanks

  91. Martin Kliehm

    Thomas, it’s good to hear that the plugin works with WordPress 2.5. I didn’t download any beta yet, mainly because any minor issues could be fixed during the first two days of the release when I install 2.5 on my system anyway.

    Concerning the question custom fields vs tags I’m convinced they belong into tags. When you write about an item, the most accurate way to describe what you where writing about would be to refer to them by a unique ID, like the ISBN. Certainly such a machine tag is a tag, so it’s OK for them to appear in tag clouds as well. If the tag wouldn’t be related to the actual post (like Wii points), perhaps you could use the third way to implement tags: the default tags in the options menu.

    David, I’m afraid I need more input. A URL would be a good start. Otherwise the main reason things don’t work is because the Amazon API needs your XSLT, so it needs to access your server. Anything on an intranet or localhost won’t work.

  92. Jeremy

    I’m sure I’m being stupid here but I think I might have this all backwords. I got to the point of putting in the sidebar fine. I’m getting confused as where and/or how to add amtap amazon:asin=B000PLXEXE. I’ve tried it many different ways:

    • amtap amazon:asin=B000PLXEXE
    • [amtap amazon:asin=B000PLXEXE]
    • <?php amtap amazon:asin=B000PLXEXE; ?>

    All three were tried paisted in the sidebar, in a post, and in the tag of a post. None worked. Where am I making this stupid mistake?

  93. Martin Kliehm

    Jeremy, there are indeed several mistakes. ;) The different ways to have amazon items in your blog are:

    • In the sidebar of one post: <?php AMTAP::get_items(); ?> plus machine tags like amazon:asin=B000PLXEXE in the tags field of that post.
    • In the sidebar of your whole blog: in the admin section of this plugin is an input field “default tags” where you can add machine tags like amazon:asin=B000PLXEXE
    • Within the text of an article:
      [amtap amazon:asin=B000PLXEXE]

    Also the item B000PLXEXE must be available in the Amazon locale that you have chosen. If you try to display a Japanese ASIN in the US shop, there’s a high chance it won’t show.

  94. Jeremy

    ok… I corrected the coding, but I’m still unable to see anything. Is it maybe a bug with WP 2.5RC1?

  95. Jeremy

    I believe I’m getting somewhere now. I am now seeing something in my sidebar, though it is an error message:

    […] Your ResponseGroup parameter is invalid. Valid response groups for requests include […]

  96. Martin Kliehm

    David, Jeremy, I just updated my blog to WordPress 2.5, and except from minor optical issues with the new look of the admin section everything went well. Your server can access your MySQL database via localhost, but Amazon cannot fetch the required XSL file from your server if the domain is localhost or, perhaps there was a misunderstanding.

    Otherwise the error text suggests that you have changed the default Response Group parameter in the plugin (the field labeled “don’t change until you fully understand what you are doing,” it’s there for advanced users). The value in that field should be Images,Medium,Offers,Reviews — without spaces.

  97. brandan

    i am trying to use the amazon machine tags module for its inline item information functionality. i have tried:

    [amtap book:isbn=978-0553803716] as my first test and the text between brackets does not seem to be interpreted at all.

    the post in which i made the attempt is located here:

    i have the debug checkbox ticked. i’ve read through all of these responses and not found a suitable solution. any help would be much appreciated.

  98. Martin Kliehm

    Brandan, try removing the dash. The regular expression currently just checks for numbers in the ISBN, but I can enhance that in a future version. Both (old) 10 and (new) 13 digit ISBNs should work, but Amazon’s search engine sometimes doesn’t return a result with a ISBN-13 request. If that occurs, try ISBN-10.

  99. Kaffeeklecks-Welt » Eingesetzte Plugins

    […] Amazon Machine Tags — Ein Plugin welches zu einer ISBN Nummer die passenden Buchcovers holt. […]

  100. klecks


    It is a wonderful plugin. i love it! But for some books the plugin embed no thumbnail. i cannot explain myself why it is…

    here is my example

    one further feature request: a webgui checkbox to open amazon links in a new window. i solve it manually in the amtap-html-content.xsl file.

    greetz, klecks

  101. Stephen Root

    I can’t seem to get things working here.

    I’ve tried entering:

    [amtap amazon:asin=B0002H0RI6]

    in my blog post but I can’t get anything other than that text to show up in my post.

    Any help please?

  102. Kaffeeklecks-Welt » Pagenews

    […] Das Bookcover Plugin gegen das Amazon Machine Tags ausgetauscht. […]

  103. James

    I recently installed your plugin, and keep getting an error message “The access key you entered is invalid. Please double-check it.”

    The key I’ve entered is definitely the correct key. Any ideas?

  104. Martin Kliehm

    Klecks, the issue with the missing thumbnail seems to have been temporarily with Amazon as it appears now. Also I’ve noted that opening a link in a new window and being able to edit the headline in the sidebar are most requested features and would save a lot of people the pain of editing unfamiliar XSLT. They will definitely be part of the next version.

    Stephen, it seems you experienced the same issue as Klecks. I’ve tried the tag, and when I set as default and disable the inclusion of ip2country (as the item is unavailable at other Amazon locales), the record crate appears with a thumbnail now.

    James, the most common case when you get the invalid key error message though you are sure it is valid is when you try to run the plugin locally. Amazon needs to fetch the XSL file from your server, and when it is localhost that won’t work. That’s a fairly common mistake, so in the next plugin version I will check if the plugins runs locally first and change the error message accordingly. Sorry for that.

  105. Alex

    Hello, great work.

    1. Question: we are more than one author on the blog and whant to submit an partner-ID with the tag. Something like [amtap amazon:asin=B0002H0RI6 id=partnerid-20]. Is this possible?

  106. shadaik

    Somewthing weird I’ve seen for some time, but now I finally understand what causes it: It seems that product names that include a stop end at the stop. I do not know however, wether this is caused by amazon or a glitch in amtap. Weird, nonetheless.

    Had an extreme example of this here and blamed it on amazon for the time being ( ;-) ). Almost all titles listed there include a stop somewhere, usually because they include words such as Dr. and Prof.

  107. James


    Still getting the same error message that access key is invalid in the WordPress AMTAP settings configuration screen, and no output to web site. Using WordPress 2.5.

    I tested my Access Key ID right in my web browser per the instructions on Amazon’s AWS web site, using following link (with the XXXXXXXXXXXXXXX being my access key), and it worked perfectly with a valid reply:


    Anyway, I am running several other plugins successfully — and while I’m not a programmer, I can usually hack my way to a solution. Not sure what you mean by running it from local host … but as I said, it’s installed on my web host.

    Any other thoughts or things I can tweak to get this going?


  108. Martin Kliehm

    Alex, I think it would be possible to include a partner-id in the post, though it would be irritating because being allowed to override the configuration settings and working just for one locale. I can imagine that would result in more questions coming in here. For the moment I would suggest to get one partner-id for the blog and share the incoming revenue equally among the authors. ;)

    shadaik, that’s annoying indeed. Actually cutting off the title after a period was thought as a feature because I always encountered them in lengthy book titles with several sentences. But I see it is certainly buggy when something is cut off after “incl.” That will be fixed in the next version. For the time being you could change that part in the XSL file.

    James, the issue most certainly is that Amazon cannot fetch the XSL file from your server. One reason could be if you test the site locally with an internal IP address like Another possibility is that the access to the file is not allowed. Please try to enter the URL for the file in your browser, like wp-content/ plugins/ amazon-machine-tags/ amtap-key-verification.xsl, and if that returns “access denied” you have to change access rights.

  109. Joe

    Hi. I’ve installed this plugin and have it working on my site. However, it’s displaying the wrong prices for products (see example above).

    I was originally using it with the AZ-One plugin (which is much easier to install and activate than ip2country, which just confused me), but I disabled this to make sure it wasn’t causing an issue.

    The url above shows three prices. These are $34.98, $34.98 and $18.98. The actual prices on the Amazon site are $32.99, $31.49 and $13.99 – obviously a big discrepancy. The same happens when I change the default location to another store (the price differences for my own location, UK, between the amounts displayed on my site and those on Amazon, are £19.99/£8.97, £19.99/£9.47 and £11.99/£8.98.

    I’ve no idea where these increased prices would have come from, but it looks as though the plugin is pulling out the wrong data. Can you help?

  110. James

    Thanks for your patience . . .

    I tried the URL you suggested from my browswer, and here’s what was returned:

    - - - - - true

    Does this response mean it’s working, and there could be some other issue? Also, I did a search and was not able to find my access key ID anywhere in the code of the plugin (although it does show up in the admin panel every time I bring that up).


  111. soggyindo

    Hi, thanks so much for all your work! My favorite aspects of your plugin is its ability to include prices, and come back “clean” without an amazon logo. Lovely design!

    I’ve just got one question: is it against amazon terms of service (TOS) to include products and such without their logo? I thought i read somewhere if you are an affiliate, you have to show an amazon logo or say something about being associated with amazon in words – or include both. Just wondering what the rules are on that, and how it affects your plugin. because i just love it clean, but it would worry me every night… Cheers!

  112. baron

    hi there. thanks for plugin: Does anybody know if tis script is compatible with WordPress 2.5.1? Thanks in advance for any help on this!

  113. Martin Kliehm

    baron, yes it is compatible. I just upgraded to 2.5.1, and everything is normal. Though there are various ways to use this plugin, and I haven’t implemented all in this blog (perhaps I should). If you run into any trouble, let me know.

  114. jn

    Hey Martin,

    Excellent plugin. A few questions:

    1. I am trying to run this with WordPress MU and am not sure if it is supported. I have successfully installed it on a site running non-MU version 2.3.1 and it appears to be running great. Any insight on the possibilities of a version that runs on MU?

    2. This might be simple, but in the working version I am looking to display the editorial review / product description.

    My Response Group now reads: Images,Medium,Offers,Reviews,EditorialReview

    The Editorial Review does not display. Any insights into this?

    Thanks again!

  115. Martin Kliehm

    Hi jn, so far I haven’t had the chance to run the plugin on a WordPress MU installation, so my guess is as good as yours. Concerning the Editorial Review: to be displayed it needs to be transformed into (X)HTML by the XSLT. It isn’t in there by default, so you need to edit the file. ;) I chose XSLT to offer maximum flexibility for users, and as long as you take care not to overwrite your changes when updating the plugin it should be OK.

  116. ovidiu


    I was just wondering about a few points of this plugin:

    a) how does the entering of such strange tags affect tag clouds and the like? Actually I wouldn’t want amazon ISBNs cluttering up my tags… do they? and is there another way to use the plugin, I mean by just using the right tags inside a psot but not by tagging the article? b) can this plugin also be used to show a list of recent books in the sidebar? as far as I understand right now it will only show something in the sidebar, if someone is actually reading a post tagged with this plugin right?

  117. Martin Kliehm

    Hi ovidiu, to my knowledge tag cloud plugins are not aware of machine tags yet, so probably yes, they would be displayed, and that is an annoyance. Still, the machine tag format isn’t new and authors of those plugins would be well-advised to ignore them (the way flickr does it). I assume they are open to such a suggestion.

    Another way to use the Amazon Machine Tags plugin is indeed with inline tags that won’t affect tag clouds. The third way is convenient especially for book authors: there’s a field in the setup for default tags that appear on every page. It’s not quite clear for me what you mean with “recent books” — recent books by an author? recent book reviews in any post? — but the default tags could be used for that. Though they need manual editing, there’s no automation.

  118. ovidiu

    thx for your answer, it made a few things clearer for me. to be honest, what I was looking for, was actually a mixture of plugins. One one hand I found different plugins, that could pull in lets say books from amazon, mixing them with your ID so you could get something back, if they followed the link to amazon and bought them, making it easy, i.e. to write reviews, get thumbnails into your posts. On the other hand I found a different kind of plugins, like the “now reading” plugin by rob miller, (don’t want to give a link here, as I am not sure its ok) which help by also allowing you to pull in links from amazon, also very beautifully allowing you to show off your library, also having a nice sidebar widget but lacking the option of using your amazon “ID” — I say ID as I do not remember the term they use, but I guess you know what I mean.

    This now reading would be perfect for me if it would be using all amazons features like your plugin does by using their API.

    Anyway, I am happy I found your plugin, saw all that it offers, but still have to decide which way to go.

  119. Review: Amazon Machine Tags

    […] Amazon Machine Tags (version 1.1.2) WordPress Extend […]

  120. John

    Hi Martin, thanks for the excellent plugin. I have played around with the formatting to show list price (with strike-through) and “our” price, plus having the link open in a new window and no problems. What I would like to do is show the Average Customers Reviews – when I set it up it showed a number, eg. 3.5 – any idea on how I could show the stars, or is that quite complex? You are also correct in that it is annoying having the machine tags show up in the tag cloud – I will have to work on that one.

  121. John

    Hi again Martin, I have managed to exclude the machine tags from the Simple Tags tag cloud now, so all that’s left on my wish list is being able to include the average customers reviews in stars rather than numeric – any thoughts on how to do this?

  122. Carsten Knoch


    I notice something else about AMT that would be great to address. On my site, I use it mostly to reference CDs on The default configuration doesn’t retrieve the main artist of a CD. Instead, the listing shows the cover image, the title of the CD, and – in smaller letters, below – the record label, year, type of media,and price.

    How would I get the artist to show up? Is that something you could do in a future release?

    Thanks, Carsten

  123. Steve Fleming

    Hi, I’ve installed Amazon Machine Tags and I have the books displaying correctly in the sidebar. My problem is that when I went back to the option page to add my associates ID and click on Update Options, I then get a 401 page error. I can’t seem to enter my associates ID.

    Any ideas?

    Thank you,

    Steve Fleming PGB Books

  124. Martin Kliehm

    John, you can achieve that with pure CSS by using the star rating in a class, like class="rating-3". Then you can associate a background-image with the class. In fact it’s a little more complex, perhaps I’ll write a post on it someday. A problem is also that you cannot use numbers like 3.5 in a classname, so you’ll have to convert them.

    Carsten, having an artist name as a fallback when there is no author is definitely a good idea and no big issue, I’ll look into that, thanks.

    Steve, that’s a strange issue. Normally you get a 401 error when you are not authorized to do something on the website. I assume you are logged in when you press Update Options and that your session is still valid. At that point the plugin doesn’t really do anything but adding/changing those fields in the database. Before that the same was done with your Amazon Access Key, and apparently that didn’t throw an error. So even if you were logged in with a lesser role than admin, the result should be the same for either action. Do you have any further information? At the moment I’m clueless.

  125. Steve Fleming

    Actually, it’s a 404, page not found error (I remembered it wrong last night. And yes, it worked for entering my Amazon Access key, but now it won’t work to save any new options.

    It could be a problem with my host, but it would help if I could provide them some more details as to what to look for.


  126. Jack


    Just downloaded and installed it but it doesn’t work. It sais that my AWSAccessKeyID is invalid (but it isn’t since i’m using it on a diffrent site with a custom Amazon ECS script). This problem happens in WordPress versions 2.6 and 2.5.1.

  127. Martin Kliehm

    Steve, the form submits to options.php that redirects to options-general.php. Both are part of the current WordPress package and can be found in the wp-admin folder. Since they are part of the distribution, I cannot imagine that files are missing. I guess it’s a problem with the redirection on your server.

    Jack, do you run WordPress locally without Amazon having access to your server?

  128. Tom Greer

    I love your plugin. It does just what I want.

    However, I am having problems getting it to appear in my sidebar in the fashion that I prefer. The only way that I can get your plugin to work is if I enter the php code at the top of the lsidebar.php file. before the test for dynamicsidebar. If I place the code anywhere else, nothing gets displayed.

    I believe the core problem is that my sidebars are widgetized. I can also get the plugin to work if I use a Samsarin PHP Widget containing the php snippet. However, once again, this only works if the widget it at the top of the left sidebar. If I place the widget anywhere else, nothing appears.

    Can you help?

  129. François


    Great plugin, very useful. I have a little question: I want to use it on a French site, and the price that it displays is formatted like “€ 10” (the American formatting) instead of “10 €” (the French formatting). From what I understand, this comes from the “aws:FormattedPrice” in the xsl, but I have no idea how to use parameters there. Is there a solution? Thanks

  130. Philix

    This is exactly what i was looking for.

  131. BananaThinking: Book info mashup

    […] this mashup resources get linked to books. The idea and the implementation is from the Amazon Machine Tags Plugin (the image on the right shows the plugin active on that site). Whenever this plugin detects tags on […]

  132. Jack

    “Jack, do you run WordPress locally without Amazon having access to your server?”

    yup, seems that was the problem :) Thank you very much.

  133. Joe

    This mostly works great, so many thanks for developing it. However, I’ve noticed that when I try and validate my site I get an error: File not found:

    I’ve installed WordPress in a subdirectory ( I suspect this is why it’s not finding the css folder and file. Is there any chance of this being changed to a relative path for future releases? I’m sure there are plenty of site owners who don’t install WP in the root of their directory.

  134. Kai

    Hi Martin,

    I am trying to set up your plug in for my aunt, who is a author. What I can see on your website is just what I am looking for.

    But: No way – I can’t get it wo work. I followed your install-instructions step by step.

    If I include [amtap book:isbn=3423209925] its just showing as regular Text inside the article.

    What I really want is to make it work inside the Sidebar, just like a widget. But what do I have to do there? I just put the code on a random spot inside the sidebar.php. Nothing. But since I have installed some widget, the template seems not to use the sidebar.php – so I also put the code inside a textfild widget…

    But Nothing happens. What am I missing? Is there a more detailed version of your install guide? the new blog, using your plug in is:

    Thanks! Kai

  135. Christoph Jahn

    A really great plugin! I am missing one thing, though. Since I expect my readers to come from a variety of countries I would love to have the following:

    • Title and picture with link to default locale (or determined from IP)
    • Config switch in link for each locale; if set to true a logo (flag?) is created with a link to the respective national Amazon store

    Example: [amtap amazon:asin=0932633137 linkAUTO linkUS linkDE]

    • As soon as more than one locale is used, the price information should not be displayed
    • I personally would also like to have a switch to disable the display of price information

    Thanks! Christoph

  136. NextInter

    Thanks for this great plugin. On my blog, it shows only title and price. I would like to know whether it can show the production description, customer review, etc. on the post.


  137. Kevin Brown

    I seem to be having the same problem as Tom above. At first I thought the plugin wasn’t working at all until I saw Tom’s post and decided to put the sidebar code at the top of the leftmost sidebar.

  138. james

    I’m using your plugin… it works pretty well. I’ve edited the xslt document to post the description.

    But it ain’t pretty

    Does anyone know how to strip those div and other HTML tags out… or better yet does anyone have a prettier version of what I’m trying to do here?

    Thanks James

  139. Christoph

    Has someone else problems when the WordPress URL is different from the Blog URL? For me, since I changed the WordPress URL to https, I don’t get any results displayed, which is sad

  140. pete

    Is there a way to use amazon keywords to display amazon products? maybe like so:

    [amtap tags='ipod touch'] ?

  141. Andrew

    I’m trying to set this up to display some default items in the sidebar, but the items appear sporadically. Sometimes they’re there and sometimes they aren’t. I’ve tried a few different things in the Default Tags area in Configuration. First I tried something like this “amtap amazon:asin=1234567890, amtap amazon:asin=1234567890”, which initially seemed to work fine. When it stopped working I read the comments here and changed it to something like this “amazon:asin=1234567890, amazon:asin=1234567890”. This also worked for awhile, but sometimes it doesn’t. Which is right? Does it matter if it’s a mixture of books, CDs, and DVDs?

    I also noticed that when I try to save the options I get this message: “No connection to Amazon Web Services. Please retry later.” So maybe it’s a problem with AWS and not your plugin.

  142. Martin Kliehm

    Sorry for the late replies, I was on vacation…

    Tom, Kevin, Kai, you’re right, widgetizing the plugin is a top priority for the next version. Alas I have no experience yet in creating widgets for WordPress, so that keeps me from being too enthusiastic about the idea. ;) However, text replacement in the content should work.

    François, at the moment returns “€ 10”, i.e. the euro-character before the amount. But in Germany the formatting is the same, and I’m pretty sure both versions are correct. Is there an ISO norm to support your preference? Otherwise it just might be your preference and others would complain if it is changed…

    Joe, thanks for the bug report, fixing the CSS path when WordPress is not in the root directory will be in the next version. I haven’t thought of that before, but I guess that could also involve differentiation between the WordPress URL and the Blog URL, like Christoph points out.

    Christoph, your suggestion to include several links to Amazon stores in different countries at once means multiple requests to the respective APIs, waiting for each reply, and somehow putting the replies together again. That’s bad for performance and above that quite complex. What’s wrong with people getting their matching store?

    NextInter, you have to change the XSL file to display that information. I would suggest to turn on the debug mode to get the raw XML and change the XSLT accordingly. But as james found out apparently there’s a lot of very ugly, unwell-formed code in the Amazon database for reviews. Since I assume that AWS uses XSLT 1.0, regular expressions to parse the content are unavailable, so filtering becomes a pain.

    pete the idea behind the plugin was to create a way to refer specific items, so the operation is ItemLookup. What you are looking for is ItemSearch. But as the author already knows which item to refer to, I’m afraid search doesn’t make much sense.

    Andrew, just the triple (machine) tag is sufficient. There is no difference if there’s a media mixture. You get the connection error either when the HTTP response is >400, or when the response takes longer than 10 seconds. It seems to be the case that your requests take an unusual amount of time, hence missing items or the connection error result.

  143. Todd Levy

    Martin -

    First, thank you so much for this wonderful plugin. On to my question: Is it possible to pass multiple ASINs into the machine tag when using it inside a blog post? I’ve tried every combination of…

    [amtap amazon:asin=0061234001, amazon:asin=0312425074]
    [amtap amazon:asin=0061234001, amtap amazon:asin0312425074]
    [amtap amazon:asin=0061234001, 0312425074]

    … I can think of.

    Any help appreciated, TL

    P.S. For now, I’m just including multiple machine tags and it seems to be working fine, but I have to assume the performance would be better if I munged them all into one tag.

  144. Martin Kliehm

    Todd, don’t worry: multiple machine tags is the way to go.

    [amtap amazon:asin=0061234001]
    [amtap amazon:asin=0312425074]

    The tags are just parsed with a regular expression and “munged” before being sent to Amazon, so there’s just one request despite the seeming redundancy. ;)

  145. Andrew

    This definitely isn’t working for me. I’ve tried default items in the side bar, I’ve tried putting [amtap amazon:asin=0061234001] in the html of the post, and I tried amazon:asin=B001CVCB7Q in the post tags. The sidebar items never show and and with the machine tags in the post it just displays the tag, not the item.

    Like I said earlier it did work initially and I do have the correct code in the sidebar template. So I don’t know what else I can try.

  146. Martin Kliehm

    Andrew, if neither works, are you sure you have a valid key and that validation in the admin interface returned a positive result? The sidebar items won’t show if the key is invalid. Another reason could be that the particular item is unavailable in your locale. ASINs can be locale specific.

  147. Todd Levy

    Martin — amazing customer service! Can’t believe how quickly you replied to my last question.

    Here’s another one. I’ve been on the hunt for a solution for quite some time, and given my history with doing that, I’m sure it’s something so simple and obvious.

    When I use "amtap-html-content.xsl" to parse the xml, it’s getting returned with a <br/> tag immediately preceding the h3 tag.

    And what’s really throwing me is that if I move the h3 above the image in the code, it doesn’t give me the superfluous br in the output.

    As before, any help greatly appreciated.


    P.S. Karma checkbox selected. Given the utility of this plug-in and remarkable customer service, I’m thinking you could get away making that thing opt-out.

  148. Alex

    I second the request to open the URL in a new window however I solved it the same way as stated above.

    One other thing I had a problem with initially was 13 digit ISBN’s. I was trying to use the ISBN-13 from amazon but then everything worked fine when using the ISBN-10 from amazon instead.

    Thanks a lot for a great plugin!

  149. Martin Kliehm

    Hi Alex, err, since version 2.0 of the plugin there is an option in the admin interface that lets you decide whether you want links to open in a new window or in the same (recommended by usability gurus), so there’s no need to hack the XSL for that purpose anymore.

    You’re right, it seems the Amazon API has issues with searching for ISBN-13.

  150. Jeff Wendorff

    Rather embarrassed that something seemingly easy is eluding me. I have everything setup and confirmed with Amazon, I also got the confirmation from the plugin after installation.

    So I added this tag [amtap amazon:asin=B001ENOZY4] in a post and I get that text in the post.

    My expectation was that this would result in a link to Amazon inside the post. Then by tagging the post with the code it would show up in the sidebar.

    Any advice?

    Andrew did you get your similar issue resolved?

    Thanks in advance. Jeff

  151. Jeff Wendorff

    Well it seems I was only partially correct or wrong. Even though I am getting the asin from the same US site, it does not always give me the link. Some do and some don’t… Is it Amazon or me?

  152. Amazon Machine Tags Plugin for WordPress - WP Plugin Archive

    […] dem Amazon Machine Tags Plugin for WordPress von Martin Kliehm können auf einfache Weise Amazon Artikel inklusive Vorschaubildern in […]

  153. Melissa.Boyd

    Thanks so much for this plug-in!

    For those of you that only see the “text” for the machine tag in the post, make sure you are not copying and pasting from this web page into the “visual” html editor in WordPress. A very simple mistake… that had me confused for a while! LOL

  154. Andrew

    “Andrew did you get your similar issue resolved?”

    I tried everything suggested here, but never could get it working. I have given up on this plugin and deactivated it.


  155. Martin Kliehm

    Jeff, to find out whether it’s Amazon or you I’d recommend to turn on the debug mode and take a look at the XML that’s returned by Amazon. If there are error messages in there, you will know who’s fault it is. ;)

    Melissa, thank you so much for the hint. I needed to escape the brackets in my text to avoid them being replaced here. :)

  156. Larry


    First off, thank you for this plugin, it’s Amazing!

    The one question I have, is that it seems to display an average price for the item, taking into account all of the amazon stores. Is there a way for it just to show the actual Amazon price?



  157. Doug

    Will this plug in search the tags even in they are not formatted in the machine way.. for instance if a have a tag that says “samsung 1080p TV” will it bring back results for that search?

  158. Martin Kliehm

    Larry, in response to an earlier request the order in which a price appears is LowestNewPrice, ListPrice, first offer, LowestUsedPrice. That seems reasonable for most users, but if you need to display the ListPrice you can do it by changing the XSLT files.

    Doug, I’m afraid using all tags for search requests on Amazon would return a large number of useless products since not all tags are intended to be product names. I think the machine tag pattern is a useful filter for the requests.

  159. Matthias Pannek

    First thanks for this plugin =)

    Second, is there any way to use smaller pictures? TinyImage is too big for me?


  160. Fred

    Hi Martin,

    Great plugin – thanks for your work. Is there any way to increase the information pulled from AWS? I would like to be able to display the product details and product description in my post.



  161. cabotine

    Hmm, I installed it with WordPress 2.7 and sadly it dont work out. I tried using this in a post but it is just shown as typed…

    [amtap book:isbn=3781513661]

    I validated my amazon key and the plugin is activated Does anyone know what can be wrong? Or is WordPress 2.7 just really not supported until now? Regards C.

  162. cabotine

    solved it… it was because it got formatted as [code] accidently... nice plugin...

    but it kind find any hint to include the editors review of a book It would be great if you can give us a hint how to change the xslt file... Thx. C.

  163. cabotine

    Hi, I tried to find the product description in here […] but actually I cant find it… any hints? Thanks alot

  164. et


    got stuck with the plugin, giving me the message:

    No connection to Amazon Web Services. Please retry later.

    i’m quite sure that amazon won’t allow such a long downtime of it’s web service, so i’m wondering if i overead the part where it says that you’ll have to open specific ports for amazon on your server..?

    thanks! et

  165. et

    hi martin, can you help me with the

    No connection to Amazon Web Services.

    error? what connection rules/servers need to be allowed for the web services. please help. if i can’t get it running, i’ll switch to another plugin… thanks in advance! et

  166. 为你的affiliate商店建立一个wordpress博客 : 互联网营销

    […] Amazon Machine Tags: 这是一个免费的插件,通过ASIN号码添加amazon的产品到你的blog post中去,优点:使用简单方便。不过现在amazon新推出的深度链接工具也不错,我更喜欢amazon官方的工具,不过每个人习惯不同,或许这款插件更适合你。 […]

  167. Jeff

    I have had to delete the wp tagcloud from my website’s sidebar because the cloud lists every machine tag code. Any idea how to exclude amtap machine tags from the cloud while not excluding other tags?

  168. François


    The plugin worked perfectly (WP 2.5) and suddenly it doesn’t anymore. I get a message “Warning: filegetcontents() [function.file-get-contents]: URL file-access is disabled in the server configuration in [My site]/wp-content/plugins/amazon-machine-tags/amtap.php on line 336″, and another one about “no suitable wrapper” at the same line. When I go to the plugin configuration page and check the Amazon Web Services Access Key ID, it says “No connection to Amazon Web Services. Please retry later.” I checked the AWS page, and it works, I can see my Access Key ID. Any idea what’s happening? Thanks.

  169. Martin Kliehm

    @et: please try if wp-content/plugins/amazon-machine-tags/amtap-html-content.xsl is accessible in a browser or if it throws a 403 forbidden error. If that’s the case you probably need to adjust the permissions settings for the amazon-machine-tags folder.

    @François it seems like somebody changed the server configuration. The plugin has two ways to request the remote XML file from amazon, preferable with a cURL request, or if that fails, through file_get_contents. The latter method has been changed in PHP 6. So either something changed in the PHP configuration, or somebody updated to PHP 6. I think it’s still too early to support PHP 6, but I will keep support for the new function in mind. In the meantime, could you please check the PHP version on your server? Just create a PHP file with the line phpinfo().

    @Jeff, that’s an issue with the tag cloud plugin which should ignore machine tags as they are not meant for humans.

    @Fred, cabotine, you can play around with the ItemLookup options at AWS Zone. By default the plugin requests Images, Medium, Offers, Reviews. If you would like to get the product description, you need OfferFull or OfferSummary in addition. You can tweak those params in the plugin’s settings, but also you need to adjust the XSL files then.

  170. François


    I checked the PHP version, it’s 4.4.3.

    Any other reference you might need?

    It seems that the curl functions have been disabled, in the “disable function” I can see: curlclose, curlcopyhandle, curlerrno, curlerror, curlexec, curlgetinfo, curlinit, curlmultiaddhandle, curlmulticlose, curlmultiexec, curlmultigetcontent, curlmultiinforead, curlmultiinit, curlmultiremovehandle, curlmultiselect, curlsetoptarray, curlsetopt, curlversion, socketconnect, socketcreate, socketcreatepair, socketread, socketrecv, socketrecvfrom, socketsend, socketsendto, socketwrite, fsockopen, curlclose, curlcopyhandle, curlerrno, curlerror, curlexec, curlgetinfo, curlinit, curlmultiaddhandle, curlmulticlose, curlmultiexec, curlmultigetcontent, curlmultiinforead, curlmultiinit, curlmultiremovehandle, curlmultiselect, curlsetoptarray, curlsetopt, curlversion, socketconnect, socketcreate, socketcreatepair, socketread, socketrecv, socketrecvfrom, socketsend, socketsendto, socketwrite, fsockopen

    I have no idea whether this is recent or not, but I don’t think it is.

    So, what can I do to fix this?

  171. cabotine

    Hi, I tried to find the ProductDescription and actually it is not available. told me that aswell and asked me to use the aStore. :( What a pity. Thank you for the plugin anyway

  172. et

    hi martin, thanks for the feedback. tried your hint on wp-content/plugins/amazon-machine-tags/amtap-html-content.xsl. can access it without a problem. any other idea? cheers, et

  173. Andrew Gray » A Brief Review of Wordpress at

    […] Amazon Machine Tags is for Amazon affiliates who want to list books and other merchandise and possibly make money that way. I have it installed but rarely use it. I noticed the prices it displays are much higher than the real prices at Amazon, so I went into my CSS styles and made the price information white text (invisible). […]

  174. Chielos

    Hi Martin,

    Great plugin, works perfectly. I also got the ip2country to work. Excellent! Maybe you have a hint for the following. I have a website with first lines of books. I don’t want the user to see the book details returned by Amazon, but only a gerenic text with a link to the book. Is there a way i can replace this text with a generic text like ‘click here for the book’ and keep the url to Amazon?

    Thanks! Chiel

  175. klecks

    Hi Martin,

    is it possible to change the standard language for some posts or pages? example: default i wrote in german language, and all books have to asked the german amazon. but some posts are in multiple language and i have the wish to present the book in this language. like this: amtap lang:es book:isbn=1234567890

    regards klecks

  176. Gerd

    Nachdem ich das Plugin monatelang problemlos im Einsatz hatte, funktioniert es jetzt bei mir über Nacht nicht mehr. In der Sidebar wird nur noch der unformatierte XML-Text angezeigt und in den posts nach sekundenlanger Wartezeit überhaupt nichts mehr. Da ich am Plugin nichts verändert habe und außer mir offenbar kein anderer das Problem hat, erwarte ich mir hier keine Hilfe dazu, wollte es aber mal gesagt haben. Ich werde mich jetzt wohl daranmachen müssen, die machine tags aus allen posts und pages manuell wieder herauszufischen. schade und ärgerlich.

  177. Dieter

    Hi Martin,

    great work. I love your Amazon Machine Tags Plugin. Thanks for it!

    However for speed ressons I like to reduce the number of requests. For that I copied the content of the amtap-blog.css in the style.css of my theme and deleted the content of echo for the amtap-blog.css at the end of amtap.php.

    It would be nice, if this could be set at the configuration page of a further version of the plugin similar to Search Hilite.

    Best regards, Dieter

  178. Chris

    Hi ich versteh nicht wie ich “Put in your sidebar and start using machine tags”,

    Muss ich den HTML Code mit dem Themeeditor in “r-sidebar” einfügen und kann ich dann den TAG als Text in die Sidebar einfügen?

    Ich habe ewig herumprobiert, kriegs aber nicht hin. Gruss

  179. Bryan

    Can you explain to me how I can feed a custom machine-tag set into the AMTAP::get_items() function for use in my template files (in a single post, not sidebar) without it returning just a string of the results, but instead actually returning the html based of the XSL template?

    I’m using AMTAP::get_items(array(‘amazon:isbn=123456789′), ‘content’); but it just returns a huge string of all the XML without any node tags or anything.


    […] jeder Hinsicht klasse ist das Amazon Machine Tag Plugin. Damit lassen sich gezielt Daten zu einem bestimmten Buch in WordPress-Artikel einbinden, indem man […]

  181. dgoodchild

    Great plugin — almost perfect for my needs. I have a couple of questions: I’m trying to edit the .xsl file to add a <br /> after the image (so the title appears on a new line below). I assume I’m not going about this in the right way ? I’ve tried just adding text to test it between <p> tags, which displays ok. Though when I change the text, sometimes it refreshes, sometimes it doesn’t.

    Also, is it possible to code it, so the price text gets added to a custom_field?

    This would be handy, to enable search results which include other (non Amazon) results appear in price order.

  182. Martin Kliehm

    @dgoodchild, if you’d like the title to appear below the image, the easiest way would be changing the CSS of the image to display: block;.

    Regarding your second question: it is possible to combine multiple XML results in the XSLT transformation. I was thinking of implementing the contents of an XML from the European Central Bank where they provide daily updates on the exchange rate of euros, but if you want to do something similar you need to have some XSLT programming skills. In XSLT it’s fairly easy to sort results, but I’m not sure if it is still compliant with the Amazon license using the results for a price comparison.

  183. dgoodchild

    sorry to be dumb, but the amtap-blog.css already has display: block; as the default doesn’t it ? also, I wanted to add an extra image (the same one each time) after the product image. Is this a complex process to implement with xslt ?

    I take your point about the license issue regarding price. Along those lines though, would it be possible to fill the wordpress title field with the amazon title?

  184. dgoodchild

    just wondered if the plugin is going to be affected by the recent Amazon announcement re authentication? I received a mail from them:

    …renaming the Amazon Associates Web Service as the “Product Advertising API.” … In addition to the new name, signatures will be necessary to authenticate each call to the Product Advertising API. This requirement will be phased in between May 11 and August 15, 2009, and by August 15, 2009, all calls to the Product Advertising API must be authenticated or they will not be processed.

  185. David Buchan

    Fantastic work. Took a moment to get it running. Once I had my associates-id there it was fine. However, editing changes to XSLT don’t seem to work. Is there some caching I’m unaware of. I refreshed my browser cache.

  186. programmernovice

    Hello, the plugin doesn’t always work: it works on a post, but not on a category page. Is it possible to make it work on category page? Thanks.

  187. Martin Kliehm

    @dgoodchild, technically it would be possible to fill the blog title with the Amazon book title. Probably there’s a hook or filter a custom function could use to overwrite the default title. I’m just not convinced of the benefit of such an extension. I believe if you blog about books anyway the extra effort to manually edit the post title is minimal. ;)

    And yes, excellent observation: the forthcoming API change requiring authentication effects the plugin. But I’m aware of the August 15th deadline and will try to provide a revised version by July 15th, giving users sufficient time to update.

    @David, as the number of API requests is limited there are local cache files in wp-content/cache with names like amtap-aws-items-for-post-*.html. You can either delete those files manually (do not delete amtap-aws-key-verification.txt) or set the cache age in the plugin’s settings to one second for testing purposes.

    @programmernovice, that’s true. As category pages do not have any tags and inherit the tags from the newest post, it doesn’t make much sense to display any books on that page. But there’s an advanced option where you can enter machine tags of books that will show on every page, for example when you are the author.

  188. David Buchan

    Thanks for the cache info. I’ve set the age as 1 second and tried deleting files as needed. They are being re-created but it seems that changes in amtap-html-content.xsl are not flowing through. If, for testing purposes, I change class=”author” to class=”abcauthor” simply to create a change I can look for I still get class=”author” in the html after changing the cache age and/or deleting the cache file.

    I’ve tested with clearing by browser cache and across browsers (firefox and IE). Until I know what’s happening here and why the changes are flowing through immediately it’s difficult to adjust formatting.

  189. Dave C

    Hello, I’m using the Shortcode in the middle of a Content Page, yet it displays the Publisher, Author, And Price. I don’t want any of these to show. I’ve tried to edit the XSLT and broke the whole thing. Is this possible?

  190. Breanne

    I’m having the same difficulty as David Buchan with regards to the caching. In my case, I’m trying to replace the H2 used for the heading with an H5; I’ve made the changes to the xsl file, changed the caching time to 1 second, deleted the cache file and cleared browser caches to no avail — still getting those darn H2s :-)

  191. Alex Gold

    Hey Martin – Hate to bug you, but I have a question. Posting an item on a blog seems easy enough, but do the postings on the sidebar rely on what specific blog entry is on the screen or is there a way to control which books show on the sidebar independently of which entry is currently showing?

    Also, how do you add them to the sidebar? I tried add adding “[amtap book:isbn=1590521358]” to the sidebar.php text (after the normal code), but that didn’t do anything. The entry ones are working great though.

    One more quickie. If the visitor navigates away from the initial page I linked to, will Amazon still give me referral credit if they purchase a different item? I know it usually does, but I figured it’s better to know than be wrong ;)

    Thanks for the help!

  192. Alex Gold

    On second thought, two more questions.

    I would like to modify the output of the plugin so that it writes as thus (hopefully it shows this as HTML instead of trying to parse it):

    Today’s “Book of the day” (Here would go the normal code output)

    I know I can edit style changes with the CSS files, but I don’t think that would be able to encompass this kind of change.

    Second, what do you mean by “machine code” in the directions? I think of binary code with that term, which I doubt you are referring it ;)

  193. Alex Gold

    Sorry for the third comment, but I see that it didn’t keep the HTML code in the previous comment. Here is is (replacing < and > with { and }):

    {fieldset style=”text-align:right;”} {legend}{b}Today’s “Book of the day”{/b}{/legend} (Here would go the normal code output) {/fieldset}

  194. Robertino

    Hello Martin,

    Thanks for this wonderful plugin. I’ve got a couple of lenghty questions for you.

    1. Create a wp-content/cache/ directory with permissions set to 755, or 777 if you create the directory as root user.

    Is it enough to change the following files and lines of code, to change the location of the cache folder? Or would it be better to make the cache path a new input box for an absolute path in and after confirmation define AMTAP_CACHEPATH in this file instead of in amtap.php ? With a persistent default of ‘wp-content/cache/ as a relative path’. I want to create the ‘cache’ folder outside (at the same level as) my WordPress installation folder.

    File amtap.php line 54 : define( 'AMTAP_CACHEPATH', ABSPATH . 'wp-content/cache/' ); // Cache path

    File line 64 : <?php _e( 'Create a wp-content/cache/ directory with permissions set to 755, or 777 if you create the directory as root user.', 'amtap' ); ?>

    File readme.txt line 29 : 1. Create a wp-content/cache/ directory with permissions set to 755, or 777 if you create the directory as root user. BTW, why are your installation steps all numbered 1 ? :)

    2. You can edit the server-side, semantic and valid XHTML output via XSLT, change the CSS, or translate the admin interface through .po files. Actually Amazon loads the XSLT file from your server and processes it on theirs, so you shouldn’t block HTTP access to the plugin directory, and localhost doesn’t work either.

    Would it be possible to have a new input box for a relative path to a “user-mods” folder in file ? (In this user-mods folder there would also be ccs, and js folders and the 2 xsl files amtap-html-content.xsl and amtap-html-sidebar.xsl.) And if there is a relative path filled in, that the plugin will first look for any .css, .js, and .xsl files in the user-mods folder ? Failing that, it will use the relevant .css, .js, or .xsl file from the default distribution. So initially the user-mods folder will not even exist, and only the modified files should be in this folder. The new box with the path will be blank in the admin panel. But when entered in the admin panel, must exist. “user” folder with in it a copy of the “css”, and “languages” folders including the files, and the 2 .xsl files : amtap-html-content.xsl and amtap-html-sidebar.xsl ?

    TIA, Robert

  195. clynton

    I was a little confused by your instalation instructions. On #4, add something about where to enter the Amazon key. After I activated the plugin, I finally realized there was a link to adjust the settings for the plugin. Then I found the field asking for the key.

    Otherwise it worked like a charm! I have a music page where I can list my favorite tunes I run to and they look beautiful. Thanks!!

  196. Wolfgang

    Hi Martin,

    what about this API change requiring authentication update? Are you on it?

    thx Wolfgang

  197. Amy Hutton

    Can this plugin be used with the wp auto tagger plugin?

  198. Fred

    Is there an update for Amazon’s new authentication policy?

  199. Martin Kliehm

    @Wolfgang, @Fred: yes, I’m working on it. Sorry for the delay.

    @Amy, I don’t know that plugin. As long as it produces tags in the usual WordPress tag format the origin shouldn’t matter.

    As far as the other requests about XSLT, caching and new features are concerned: I’m considering a more flexible solution for the cache path, in particular for compatibility with WordPress MU. Also XSL transformations on your own server (with Amazon just delivering the raw XML) would be an option. Still this is of lower priority than the API update. In the meantime: if you don’t know XSLT or CSS, don’t touch it. ;)

  200. Fred

    Thanks Martin

  201. Dieter

    Hallo Martin,

    ich wollte einfach mal Danke für Dein tolles WP-Plugin sagen. Es läuft auf meinen beiden WordPress-Installationen einwandfrei.

    Ich hoffe, es klappt alles mit dem API change requiring authentication update.

    Beste Grüße Dieter

  202. Robertino

    In the meantime: if you don’t know XSLT or CSS, don’t touch it. I do know XSLT, XML, CSS, etc., but only from ILE RPG. (PHP is coming up fast though..) Yes, I’m an oldy. I started programming on System/38, then, AS/400, iSeries, System i, i5.

    I’ll just play around with it at one of my throwaway blogs. Nothing an overwriting FTP session can’t resolve there.

    Thanks for the wonderful plugin. Robert