How to unpublish a page from search engines

In this article, we're going to learn how to hide a page from search engines (Google search, Bing, and so on) after the campaign is complete.

Currently, unpublishing pages support and remove it from the page’s listing are not available. However, here’s what you can do to minimize the pages' exposure to visitors.

Method 1:  Remove your page while keeping a backup in the Library

You can completely delete your page from your site while still holding a backup in the Library:


Step 1: From GemPages Editor, click on the "three-dots" icon > select Save Template to Library.



Step 2: Insert the backup file's name and click Save.


You can also create a new page, insert your backup from the Library and continue editing your page from here. To preview your page, click Save and Preview. After your page is ready, you can Change Title & Handle and Re-Publish it.

Method 2:  Hide the current by adding custom code

Step 1: From your Shopify admin, go to Online Store > Themes

Step 2: Select the theme you want to edit, and then click Actions > Edit code.




Step 3: Click the theme.liquid layout file if our pages turned on Header & Footer & theme.gem-layout-none.liquid if our pages turn off Header & Footer



Step 4: To exclude the Search template, paste the following code in the <head> line:

{% if template contains 'search' %}
<meta name="robots" content="noindex">
{% endif %}


Step 5: To exclude a specific page, paste the following code in the <head> section:

{% if handle contains 'page-handle-you-want-to-exclude' %}
<meta name="robots" content="noindex">
<meta name="googlebot" content="noindex">
{% endif %}


Make sure that you replace the page-handle-you-want-to-exclude with the correct page handle. Kindly check this article out to find the page handle

Step 6: Click Save.


Note: You can make a page hidden in the Shopify pages manager. However, when you open it in GemPages there will be a 404 Page Not Found message.


Was this helpful?