Alexa Graph and Badge Shortcodes for WordPress

Alexa is a web analytics company of the Amazon brand. The website statistics published by Alexa are extrapolations from data gathered from browsing habits and other sources. These stats can be used to compare and evaluate websites or – more frequently – to show off a website’s global and local rank. The official widget scripts for displaying rank data are found here.

Alexa Internet Screenshot Courtesy of Wikepedia

The official scripts can be displayed in widget areas on WordPress blogs but the scripts break when embedded into WordPress pages and posts.

We can craft a shortcode to allow us to place Alexa traffic scripts into WP posts and pages. The snippets below create those shortcodes.

The outbound links in the below snippets have the rel=”nofollow” attribute to protect your SEO and the target=”_blank” attribute to make the links open in new tabs.