AddThis Academy

An ever-growing library of resources to help you become a better online marketer.

How to Hide Pages on Related Posts Tools?

The related posts that appear within the AddThis tools use a blend of contextual and behavioral algorithms, as well as the unique browsing data we see across the 15 million websites that have AddThis tools. For that reason, AddThis knows what to recommend to the visitor that lands on your page, based on their behavior across the Web.

The algorithms we employ already have some pretty advanced filtering to hide unwanted URLs from appearing within the widgets, however there may be some additional URLs that you don’t want to have appear.

Hiding Content With the Dashboard

You can also hide pages you don’t want to show by going to the profile settings and selecting “Hidden Content.”

hidden-content

Once you’re there you can enter the URL you’d like to block for that profile in the field. Then click “Save” to hide it.

hidden content profile options

To unhide a URL, click the “Unhide” button to the right of the URL:

unhide-the-url

This page also gives you the ability to hide URLs that contain a specific string. *Note:* This string should contain your domain – e.g. example.com – and be at least 10 characters long.

hide-url-string

Just like with normal URLs you can unhide those that match the patter with the “Unhide” button.

Advanced Hiding Using linkFilter

For most publishers, the ability the hide just a few links from within the Dashboard is sufficient. For sites that have a lot of content that needs to be hidden, the ability to hide content based on URL or title patterns is more convenient. For this advanced feature, you’ll need to add some additional code to your pages that have our recommendation widgets. For example, suppose you don’t want any recommendations to appear from last month’s blog posts, which all have the format “http://www.example.com/blog/2014/03/name-of-your-post”. Using linkFilter, you could filter any URLs that have “http://www.example.com/blog/2014/03” in them. Here’s some example code that you’d need to add to your site to do this:

<script>
window.addThisLinkFilter = function(link, layer) {
        if (link.url && link.url.indexOf('http://www.example.com/blog/2014/03') === 0) {
            return false;
        } else {
            return link;
        }
    };
</script>

As mentioned previously, in addition to filtering by URL patterns, you’re also able to filter by the title of the page. For example, if you want to make sure that posts you’ve written that have the word “author” aren’t shown, you could add code like this to your pages:

<script>
        window.addThisLinkFilter = function(link, layer) {
        if (link.title && link.title.indexOf('author') >= 0) {
                    return false;
                            } else {
                                return link;
                            }
                        };
</script>

You can also add multiple filters using linkFilter. To add multiple filters, just add some additional if statements to the code. Here’s a more advanced example that will filter out any posts that have the word “author” or “category”

<script>
        window.addThisLinkFilter = function(link, layer) {
        if (link.title && (link.title.indexOf('author') >= 0
         || link.title.indexOf('category') >= 0)) {
                    return false;
                            } else {
                                return link;
                            }
                        };
</script>
How to Hide Pages on Related Posts Tools?
5 (100%) 1 vote

Was this article helpful to you?