Back to Community

How to Control Which Images Appear in the Pinterest Share Picker

16 threads Sep 10, 2025 PluginAddtoany share buttons

Content

One of the most common questions about the 'AddToAny Share Buttons' plugin is how to control the images that appear when a visitor clicks the Pinterest share button. By default, Pinterest's built-in image picker scans the entire page, often including logos, sidebar images, and other graphics you might not want to be pinnable. This can create a cluttered and overwhelming experience for users.

This guide explains why this happens and provides the most effective methods for taking control of your pinnable images.

Why This Happens

The Pinterest share button loads Pinterest's own official script and image picker. This picker operates independently and scans the entire HTML of your page for images. It is not directly controlled by the 'AddToAny Share Buttons' plugin. Therefore, to influence which images are shown, you need to use methods that Pinterest itself provides or use alternative sharing methods offered by AddToAny.

Common Solutions

1. Exclude Unwanted Images with data-pin-nopin

The most direct method is to add a data-pin-nopin="true" attribute to the HTML <img> tags for any images you want to exclude from the Pinterest picker. This is a standard method provided by Pinterest.

Example:

<img src="https://example.com/logo.png" data-pin-nopin="true">

You may need to modify your theme's template files or use a plugin that allows you to add custom attributes to images to implement this across your site.

2. Use AddToAny Image Sharing for Individual Images

Instead of using the standard share bar button, you can enable image sharing. This places a Pinterest button that appears on hover over specific images you choose. This method shares that specific image directly, bypassing Pinterest's image picker entirely.

To enable this, add the following JavaScript code to the Settings > AddToAny > Additional JavaScript box:

a2a_config.overlays.push({
    services: ['pinterest'],
    size: '50', // Adjust the size as needed
    target: 'img.wp-post-image' // Use a CSS selector to target your desired images
});

You can customize the target property with a more specific CSS selector (e.g., #content img, .post-image) to control exactly which images get the hover button.

3. Force the Share Button to Use a Specific Image

You can use AddToAny's event callbacks to override the default behavior of the standard share button and force it to share a specific image, such as the post's featured image. This also avoids the image picker.

The following code example will make the standard Pinterest button in your share bar share the first image found within your post's <article> tag.

a2a_config.callbacks.push({
    share: function(data) {
        // Get the first image in the post if present on the page
        var image = document.querySelector('body.single article img');

        // If sharing to Pinterest and the image was found
        if ('Pinterest' === data.service && image && image.src) {
            // Set the shared media to the found image
            return {
                media: image.src
            };
        }
    }
});

Add this code to the Additional JavaScript box as well. You may need to adjust the body.single article img selector to match your theme's structure.

Important Considerations

  • Pinterest's Limitations: It is not possible to make Pinterest's native image picker open in a new window or to curate a custom list of only a “select few” images within it. The methods above work by avoiding the picker altogether.
  • Combining Methods: Many users successfully combine these methods. For example, they use the data-pin-nopin attribute to hide unwanted images from the picker and also implement image hover buttons for key images.
  • Testing: Always clear your cache and test these changes thoroughly on your live site to ensure they work as expected.

By using these techniques, you can significantly improve the Pinterest sharing experience on your website, guiding users to pin the images you want them to share.

Related Support Threads Support