and like us on FB

While we’ve shied away from Pinterest in the past, we’re quickly catching up on lost time with a series of posts detailing various ways in which to interact with the platform. This article will show you how to include a Pinterest URL count with WordPress shortcode. If you’re not using WordPress there’s a naked PHP function that follows.

The Result

We’ll use a page from for our example because they always seem to attract a large number of pins. To render the count for a URL, use [pins url=""]. The result: 2,634.

The WordPress Shortcode

Copy and paste the WordPress function into your theme's functions.php file or, if you sensibly have one installed, your custom functions plugin. You may optionally download and install our plugin from the bottom of of the page.

If you require shortcode to work in a sidebar widget, you'll have to enable the functionality with a filter. If you're using our custom functions plugin, you'll have that feature enabled by default.

Shortcode Attributes


The URL is the page you’re requesting a count from.


By default we’ll return the number in a number format . To silence the number format feature, use n="0" or hardcode it into the function.


The cache is the number of seconds we’ll store the Pinterest count locally. Be default we’ll store it for 12 hours (3600 x12) before making another request to the Pinterest API.

The PHP Function

Used outside of WordPress, the following function can be used. Usage requires Simple Cache to avoid repeated requests to Pinterest.


  • The JSON response doesn’t come from a Pinterest API designed to function as described above. Continued availability can’t be relied upon.


Download: Shortcode (V) | WP Plugin (V) | PHP Code (V)

Shortt URL for this post: