Blog, Website & Page Publishing

MKottise
Colaborador

Negative keyword on a blog article. Possible?

resolver

There is one article I don't want appearing in the blog search when user types "consultant". Is there a way to add a negative keyword to prevent the specific article from appearing under one keyword? If there is no way to do it from the interface, is there a javascript I can use? Thanks in advance.

 

Screenshot 2021-10-25 at 16.02.12.png

0 Me gusta
1 Soluciones aceptada
Indra
Solución
Guía | Partner nivel Elite
Guía | Partner nivel Elite

Negative keyword on a blog article. Possible?

resolver

@natsumimori thanks for mentioning.

 

Hi @MKottise,

 

There are multiple ways to remove pages from the search results.

The recommanded way is by adding the page to the robots.txt. You can check out the documentation for 'Content Search' under 'How can I exclude pages from being returned in search results?'

 

It's also possible to exclude spesific sections from your page for being indexed. Then you need to wrap that section or element into the class hs-search-hidden. The documentation you can find over here.

 

Another options but is not recommended is to remove your search result from the html. To bad HubSpot doesn't display the original url, but a redirect for a search term. But the redirect does have the page ID included. So you could remove if by css. Then you can use this code:

 

.hs-search-field__suggestions a[href*="123456789"]{
  display: none;
}

 

You should replace '123456789' by your page id.

 

You can also manipulate the javascript, but that will be a lot more work. Then you have to dig into the search_input.module


Vet Digital - The Growth Agency | HubSpot Solutions Partner Agency

Did my post solve your question? Help the community by marking it as a solution

Ver la solución en mensaje original publicado

3 Respuestas 3
Indra
Solución
Guía | Partner nivel Elite
Guía | Partner nivel Elite

Negative keyword on a blog article. Possible?

resolver

@natsumimori thanks for mentioning.

 

Hi @MKottise,

 

There are multiple ways to remove pages from the search results.

The recommanded way is by adding the page to the robots.txt. You can check out the documentation for 'Content Search' under 'How can I exclude pages from being returned in search results?'

 

It's also possible to exclude spesific sections from your page for being indexed. Then you need to wrap that section or element into the class hs-search-hidden. The documentation you can find over here.

 

Another options but is not recommended is to remove your search result from the html. To bad HubSpot doesn't display the original url, but a redirect for a search term. But the redirect does have the page ID included. So you could remove if by css. Then you can use this code:

 

.hs-search-field__suggestions a[href*="123456789"]{
  display: none;
}

 

You should replace '123456789' by your page id.

 

You can also manipulate the javascript, but that will be a lot more work. Then you have to dig into the search_input.module


Vet Digital - The Growth Agency | HubSpot Solutions Partner Agency

Did my post solve your question? Help the community by marking it as a solution
MKottise
Colaborador

Negative keyword on a blog article. Possible?

resolver

Thank you, editing the robots.txt did the trick.

natsumimori
Administrador de la comunidad
Administrador de la comunidad

Negative keyword on a blog article. Possible?

resolver

Thank you for your post @MKottise .

 

@Alex_ and @Indra > Would you be able to weigh in here?