Jump to content

how to hide blog posts from searchable site

Recommended Posts

Site URL: https://www.gypset.com/

Hi,

I made my site searchable but I want to hide a blog page with lots of posts that are used to feed information to some pop ups on a map www.gypset.com/atlas  since the information is on the excerpts when you type a location on the search bar the blog post appears empty. I would like to find a way to just hide those from the search functionality on the site. I know it can be done with css but not sure how to. Hope I make sense!

 

Screen Shot 2020-09-16 at 8.57.56 PM.png

Edited by danielachavez
Link to comment
  • Replies 15
  • Views 2.2k
  • Created
  • Last Reply

Top Posters In This Topic

Go to Blog Settings > SEO and at the bottom of the dialog there are three options for hiding information from search engines? Is that what you are looking for?

1928363226_ScreenShot2020-09-16at10_53_51PM.png.a816b7bcf43714d5cb7a56ae3e048b6f.png

Let us know how it goes.

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

Link to comment
13 hours ago, creedon said:

Go to Blog Settings > SEO and at the bottom of the dialog there are three options for hiding information from search engines? Is that what you are looking for?

1928363226_ScreenShot2020-09-16at10_53_51PM.png.a816b7bcf43714d5cb7a56ae3e048b6f.png

Let us know how it goes.

Hi, Thank for this but, I want to hide the pages from the search results within the website itself. (I already hid the pages from search results on seo) Do you know any way to do it? @creedon

Link to comment

Hi, for example you can search for the word Lamu and when you click the first result you will see that the post appears empty, it was built that way because those posts are feeding the info on the pop up windows here www.gypset.com/atlas we added the search feature way after this was built and I just want to hide those empty posts form the search results on the site. @creedon

Link to comment

Add the following to Custom CSS.

.search-results

  /* corumbau */ [itemid="5e6179d6f042ba7f2e97e878"],
  /* esalen   */ [itemid="5e617a32f11f6b3cb96f5997"],
  /* lamu     */ [itemid="5e6173c14c8fbf134de4a15d"]
  
    {
    
      display: none;
      
      }

This is just some starter CSS you will need to add an entry for each Atlas Map Locations post. For each post you need to get the itemid. View source for each page and look for '<body id="item-'.

953361425_ScreenShot2020-09-23at3_45_58PM.png.327f5cefda7ba9953018a1007be0677f.png

Be sure that each CSS entry is followed by a comma except the last one.

Let us know how it goes.

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

Link to comment

Here is a little something that might make the process a little easier.

javascript: 

  var itemId = document.querySelector ( 'body' ).getAttribute ( 'id' ).replace ( 'item-', '' );
  
  var title = document.getElementsByClassName ( 'entry-title' ) [ 0 ].textContent;
  
  var s = '/* ' + title + ' */ [itemid="' + itemId + '"],';
  
  alert ( s );

First you need to be on a Atlas Map Locations post page. There are two ways you can use the above. You can type it into the address bar and then hit return. Before you hit return make sure the "javascript: " is at the beginning of the code. Some browsers strip that part out as a safety step upon pasting.

If you know how to create a bookmark in your browser you can throw the code in there creating what is called a Bookmarklet. The code then can be triggered by selecting the bookmark.

182115950_ScreenShot2020-09-23at6_20_14PM.png.1ff6ebca4985f06b823b7bb71a9d612c.png

The code throws up an alert with the title and item id.

559196350_ScreenShot2020-09-23at6_32_41PM.png.17c7bcfd45fb1cbfb04dcc0c4ccfd75e.png

You can then copy and paste the dialog content into your CSS.

The above code was thrown together quickly only for this site and to help with the above issue.

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

Link to comment
  • 1 year later...

@creedon Is there a way to hide a collection (blog) page from search enginges, while keeping the blog articles themselves visible?

Basically, I'd like to inject a summary block into a page and allow users to click through to blogs from there. But I never want them to stumble upon the /blog page itself.

Thanks in advance for your help :)

 

Link to comment
5 minutes ago, dani100 said:

Is there a way to hide a collection (blog) page from search enginges,

I'm thinking no. We don't have access to the backend of SS. Anything we can do client side I'm dubious would have an effect on search engines.

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

Link to comment
  • 3 months later...

This solution (display: none) for all the search results is so tedious. Why couldn't you implement a feature just like for SEO search where we can enable/disable blog posts to show up in the search bar? I'm doing so much copy and paste and finding itemids and the custom css is getting long... My goal is to have all blog posts never show up in squarespace search bar because we want to focus on searching for specific keywords with products.

Also, i would like to be able to put this css codes just in /search   page only, putting it in custom css means it will have to be in every single page... thanks

Link to comment
4 hours ago, mariescantrol said:

Why couldn't you implement a feature just like for SEO search where we can enable/disable blog posts to show up in the search bar?

I just don't see this happening. The site search feature has been broken for years and SS has not fixed it. Search is unreliable.

Quote

My goal is to have all blog posts never show up in squarespace search bar because we want to focus on searching for specific keywords with products.

Add the following to Design > Custom CSS.

.sqs-post:not( .sqs-post-type-store-item ) {

  display : none;
  
  }

I haven't tested this extensively but this should hide all non product items.

Keep in mind that this just hides things. So you can end up with a page full of nothing which may throw folks off thinking that there are no results. It really isn't an ideal solution.

If search is mission critical to your site then SS search is not a good solution. You should look to something like Google's Programmable Search Engine.

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

Link to comment

Thanks Creedon, we don't have a "store" though, it's complicated but our website have products but they are just stand alone webpages since they are technically services. It's okay, I think I managed to manually have a solution. Also I don't know if it's good enough code but I added a code injection in header so it only applies search filters in the search page (/search - i couldnt edit it because ss has a default page for it) and i didn't put the codes in custom css. I added console log just to check to make sure it doesn't load in all the pages:  Thanks 🙂

let myUrl = window.location.href;
    let result = myUrl.includes("search") ? insertSearchFilter() : noSearchFilter();
         function insertSearchFilter()  {
        // Get HTML head element
        var head = document.getElementsByTagName('HEAD')[0];
        // Create new link Element
        var link = document.createElement('link');
        // set the attributes for link element
        link.rel = 'stylesheet';    
        link.type = 'text/css';    
        // Append link element to HTML head
        head.appendChild(link);
        console.log("IN SEARCH PAGE");
    };  
        function noSearchFilter()  {  console.log("NOT IN SEARCH PAGE");  };
Link to comment
  • 1 year later...

Hello,

I don't know if it's a good decision to post here, but I couldn't find a more relevant article, and I didn't want to open a new one. 

The client wants the blog post authors not to be visible in search results. So I have to hide them. How?
I attach a picture with the problem. 
This domain: https://www.fintastudio.hu


Thanks if you can help!
 

image002.png

Link to comment
17 minutes ago, antasz said:

The client wants the blog post authors not to be visible in search results. So I have to hide them. How?

You can add a Basic Author with a name that matches the site name (or anything else!) and then use that for every post that is created. A Basic Author is any name that can be attributed as an author; it doesn't have login information and can be selected from the dropdown menu when adding or editing content.

If you've already added posts, edit each one and select the new Basic Author name from the list.

Did this help? Please give feedback by clicking an icon below  ⬇️

About me: I'm Paul, a SQSP user for over 18 yrs and a Circle Leader since 2017. I value honesty, transparency, diversity and good design ♥.
Work: Founder of SF.DIGITAL, providing high quality original extensions to supercharge your Squarespace website. 
Content: Views and opinions are my own. Links in my posts may refer to my own SF.DIGITAL products or may be affiliate links.
Forum advice is completely free. You can thank me by selecting a feedback emoji below. Buying a coffee is optional.

Book paid help with domains: Connect a GoDaddy domain. Connect a Squarespace Domain. Domain assistance

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.