Hello,
in a code block I have created my own submenu.
How can I exclude the content of the whole code block from the search?
Many thanks in advance.
Many greetings
Ingo
Hey Knutnik,
Thank you for the inquiry.
How can I exclude the content of the whole code block from the search?
Could you elaborate further? Unfortunately, it is not possible to exclude a specific content or element from search engines. You can only instruct search engines whether to index a page or not, but you cannot exclude or hide a specific area or element in that page.
Best regards,
Ismael
No, I didn’t mean Google search.
I meant the search function of the website (magnifying glass).
I want to exclude the one block of code I used in the upper left for my homemade submenu from the website search.
Of course, I don’t want the menu terms to show up as hits. Then almost all pages would be displayed as search results.
Is there any way to prevent this with script – or whatever?
Hi,
The search function is the basic built-in WordPress search, to exclude pages and posts you can use a plugin like Search Exclude, but you are asking to exclude a specific div from the search results and the only way I found to do this is with the Relevanssi search plugin and using the [noindex] shortcode
I tested your search for Küche & Bad & Wohnen and all of the results were pages that had these terms as H1 heading, none of the results that I saw were because of your code block submenu, are you sure that you are getting submenu results?
Best regards,
Mike