Back to Community

How to Remove or Hide AddToAny Share Buttons from Specific Areas of Your Site

24 threads Sep 16, 2025 PluginAddtoany share buttons

Content

Many WordPress users love the flexibility of the AddToAny Share Buttons plugin, but a common challenge is controlling exactly where the buttons appear. You might want to remove them from your homepage, a sitemap, a custom post type, or a footer. This guide covers the most effective methods to hide or remove share buttons from specific areas of your site.

Why Do Share Buttons Appear Where I Don't Want Them?

Share buttons can appear in unexpected places for a few key reasons:

  • Theme or Plugin Conflicts: Your theme or another plugin might be automatically inserting content into areas like footers or custom templates, bypassing the standard placement settings.
  • Caching: A common culprit! Your site's cache may be serving an old version of a page where the buttons were still enabled.
  • Unique Page Templates: Pages like sitemaps or special archives are sometimes not recognized by the standard WordPress conditional checks, so the plugin's placement toggles may not apply to them.

Method 1: The First Step – Clear Your Cache

Before trying anything more complex, always clear your site's cache. If you use a caching plugin like WP Super Cache or W3 Total Cache, purge all cached files. Also, clear any server-level or CDN caches (like Cloudflare). This simple step resolves many display issues instantly.

Method 2: Use the Built-in Placement Settings

First, check the plugin's main settings. Navigate to Settings > AddToAny and review the options under "Placement." Ensure you have unchecked boxes for areas where you do not want the buttons to appear, such as "Front Page" or "Archive Pages." For individual posts and pages, you can find a checkbox to disable sharing in the meta box below the WordPress editor.

Method 3: Hide Buttons with Custom CSS (The Quick Fix)

If the built-in settings don't work for a specific page or area, you can use CSS to hide the buttons. This is a very common and effective solution. Add the following code to the "Additional CSS" box in your AddToAny settings or your theme's customizer.

Example 1: Hide on Homepage
If your front page uses the home CSS class, this will work:

body.home .addtoany_content {
    display: none;
}

Example 2: Hide on a Specific Page by ID
Find your page's ID and use it in the code (replace '1337' with your actual page ID):

body.page-id-1337 .addtoany_content {
    display: none;
}

Example 3: Hide in a Specific Theme Area (e.g., Footer)
You may need to inspect your page's HTML to find the right CSS selector. For example:

.footer-area .addtoany_content {
    display: none;
}

Method 4: Disable Sharing Programmatically for a Post Type

For more advanced control, such as disabling sharing on a custom post type, you can add a small code snippet to your theme's functions.php file. This method completely prevents the buttons from loading.

function addtoany_disable_on_custom_post_type() {
    if ( 'your_custom_post_type' == get_post_type() ) {
        return true;
    }
}
add_filter( 'addtoany_sharing_disabled', 'addtoany_disable_on_custom_post_type' );

Important: Remember to replace your_custom_post_type with the actual name of your post type (e.g., 'event', 'product'). Always use a child theme when modifying functions.php to avoid losing changes during theme updates.

Troubleshooting Tips

  • Double-Check Selectors: Use your browser's inspector tool to find the exact CSS class of the container holding the buttons on your page. This ensures your custom CSS targets the right element.
  • Test with Caching Disabled: Temporarily disable your caching plugin while testing these solutions to rule out caching issues.
  • Specificity is Key: If your CSS isn't working, try making the selector more specific by adding a parent class or using !important as a last resort (e.g., display: none !important;).

By following these methods, you should be able to gain precise control over where your AddToAny share buttons are displayed, creating a cleaner experience for your visitors.

Related Support Threads Support