Is there a way to exclude specific CMS pages from search engines based on a specific parameter, such as a tag, in Webflow?
Yes, there is a way to exclude specific CMS pages from search engines based on a specific parameter, such as a tag, in Webflow. To achieve this, you can use the "noindex" option for these specific CMS pages.
Here's a step-by-step guide on how to exclude specific CMS pages from search engines based on a tag parameter in Webflow:
- Login to your Webflow account and open your project.
- Navigate to the CMS Collection that contains the pages you want to exclude.
- Open the Collection Editor and select the individual CMS pages that you want to exclude from search engines.
- In the right-hand sidebar, scroll down to the "SEO" section.
- Click on the "Add custom code" link under the "Header Code" field.
- In the code editor that appears, enter the following code:
{% if collection-item.tags contains 'YOUR_TAG_NAME' %}<meta name="robots" content="noindex">{% endif %}
Replace 'YOUR_TAG_NAME'
with the specific tag that you want to use to exclude the CMS pages. For example, if you want to exclude pages with the tag "noindex", the code would be {% if collection-item.tags contains 'noindex' %}
.
- Click "Save & Close" to apply the code changes.
- Publish your site to make the changes live.
By following these steps, the CMS pages that have the specific tag (e.g., "noindex") will have the <meta name="robots" content="noindex">
tag added to their HTML code. This tag tells search engines not to index the page, effectively excluding it from search engine results.
Please note that it may take some time for search engines to update their index and recognize the changes you made. Additionally, while this method can help exclude specific CMS pages from search engines, it's always a good practice to double-check and verify the exclusion by inspecting the page source or using tools like Google Search Console.