Back to Community

How to Control Where Your AddToAny Share Buttons Appear on Your WordPress Site

23 threads Sep 10, 2025 PluginAddtoany share buttons

Content

One of the most common questions about the AddToAny Share Buttons plugin is how to control its placement. Many users want the buttons to appear only on specific pages, like blog posts, and not on others, like the homepage. This guide will explain the different methods available to manage where your share buttons are displayed.

Why Do Share Buttons Appear on Every Page?

By default, the plugin is often configured to load globally across a site. This is a common setup to ensure features like dynamic loading for images or AJAX content work seamlessly. However, this default behavior isn't always ideal for every website's design.

Method 1: Using the Built-in Per-Post/Page Control

The simplest way to control visibility is on an individual post or page basis. When you are editing a specific post or page in WordPress, look for the "AddToAny" meta box in the right-hand sidebar. Inside, you will find a checkbox labeled "Show Sharing Buttons." Simply uncheck this box to hide the buttons on that particular piece of content.

Method 2: Using the Shortcode for Precise Placement

For maximum control, you can use the [addtoany] shortcode. This method allows you to place share buttons anywhere you can insert a shortcode, such as within a post's content, a widget, or even directly in your theme's template files.

  1. In your AddToAny settings, navigate to the "Placement" section.
  2. Uncheck all the automatic placement options (e.g., "Before posts," "After posts," etc.). This prevents the Standard buttons from appearing automatically anywhere on your site.
  3. Place the [addtoany] shortcode exactly where you want the buttons to appear. For example, you could add it to a specific theme template file or in the content of a single post.

Method 3: Using Code for Advanced Conditional Loading (For Developers)

If you need to disable the plugin's assets on entire sections of your site (like the homepage), you can use custom code in your theme's functions.php file. The following code example will remove the plugin's scripts and styles everywhere except on single posts or pages.

add_action( 'wp_enqueue_scripts', function() {
    // Allow only on single posts and pages
    if ( is_singular() ) return;

    // Remove AddToAny core script.
    // Note: This disables dynamic loading functionality.
    add_filter( 'addtoany_script_disabled', '__return_true' );

    // Remove AddToAny plugin's JS & CSS.
    wp_dequeue_script( 'addtoany' );
    wp_dequeue_style( 'addtoany' );
}, 21);

Important: This is an advanced technique. Always use a child theme when modifying theme files and test this on a staging site first, as it can affect functionality.

Method 4: Controlling Floating Buttons with CSS

The methods above primarily control the "Standard" share buttons. If you are using a "Floating" share bar, its visibility is often managed with CSS. For instance, to show the floating bar only on single posts, you could add the following CSS to your theme's "Additional CSS" section or in the AddToAny settings:

body:not(.single-post) .a2a_floating_style {
    display: none;
}

Conclusion

Whether you need simple per-page control or advanced conditional loading, the AddToAny Share Buttons plugin provides several ways to manage where your buttons appear. For most users, combining the built-in checkbox with the [addtoany] shortcode offers the perfect balance of simplicity and control.

Related Support Threads Support