Including & Excluding Content
By default, AddSearch includes all pages of your website in your search. In certain situations you might want to exclude certain parts of your site from the search. Also sometimes you might want to make sure that some specific content in your page gets included in or excluded from the search.
How can I exclude pages from the search?
If you don’t want certain site areas or pages to appear in the search, you can do that in multiple ways:
1. Excluding pages via the AddSearch Dashboard
You can exclude content from the search without touching your site code, by logging in to the AddSearch Dashboard and using the Site Areas tool under Settings. This is the easiest method.
To exclude all pages that reside under /temp/, just enter /temp/ into the text field and select Exclude from the dropdown box. Changes done in the Site Areas tool take effect with the next recrawl of your site, which for large sites might take some time.
2. Excluding pages using robots.txt
You can also use robots.txt, which is a text file that resides in the root folder of your website. To make AddSearch and other search engines exclude pages under /temp/ from search, insert the following lines into your robots.txt file:
To make only AddSearch exclude pages under /temp/, insert the following lines into your robots.txt file:
3. Excluding pages using robots meta tags and index/noindex & follow/nofollow rules
You can also use robots meta tags and the index/noindex and follow/nofollow rules. These need to be placed in the
HEAD section of your page.
To make AddSearch and other search engines exclude a page from the search, insert the following into the
HEAD section of that page:
<meta name="robots" content="noindex">
To make AddSearch and other search engines exclude all pages from the search that a page links to to (i.e. so that the crawler won’t follow links from this page), insert the following into the
HEAD section of that page:
<meta name="robots" content="nofollow">
You can also combine instructions. To make AddSearch and other search engines follow links from this page, but exclude this page from the search, insert the following into the
HEAD section of the page:
<meta name="robots" content="follow, noindex">
If you want to have the robots meta tags apply to AddSearch only, change
name="robots" in the above examples to
4. Excluding pages using rel=”nofollow” links
Finally, you can use the
rel="nofollow" attribute in links, to exclude the page you’re linking to from the search. Include the
rel="nofollow" attribute in the link like this:
<a href="/content/excluded_page" rel="nofollow">Link to page that is excluded from search</a>
How can I exclude content within pages from the search? Or specify certain content to be included in the search?
AddSearch detects automatically the main content in your pages, and indexes only that main content. This makes the search results better, as superfluous content (such as sidebars, headers, footers etc.) and duplicate content is not included in the search.
Sometimes you might want to manually make sure that certain content is included in or excluded from the search. You can insert HTML5 tags to your pages to mark such content.
To make AddSearch include a certain section in your page into the search, use the
data-addsearch="include" attribute in any element, typically a
<div data-addsearch="include">Content that is included in the search</div>
To make AddSearch exclude a certain section in your page from the search, use the
data-addsearch="exclude" attribute in any element, typically a
P element. Example:
<div data-addsearch="exclude">Content that is excluded from the search</div>