How do I exclude placeholders and HTML macro content from showing up in search results in my space?
Asked by Philipp:

Hello. We are building a wiki within Confluence Server for our department. This requires users to easily find content through search (either through the search box in the top bar or through the page tree search macro).

I created templates for articles with placeholder text that gives some additional instructions how to optimally structure the content of pages. According to [this Atlassian page](https://support.atlassian.com/confluence-cloud/docs/edit-a-template/), "placeholder text will only appear when a page is being edited -- it's invisible to anyone who's viewing the published version".

However, I noticed that the placeholder text does in fact appear in the search results, which contradicts the very definition of it and clutters search results with unnecessary and confusing information for readers.

On closer examination, I also noticed that the code inside of HTML macros, which we employ in a few articles, also appears in the search results, which is even less desirable.

Example: We have an auto-direct page from "Komplexit?tsvermeidung" to "Komplexit?tsmanagement". The contents of its HTML macro are shown in the search result on top. In the second result, a placeholder text ("LEER LASSEN") can be seen, which we use to mark sections that shall remain free for better vertical spacing.

![confluence search placeholders html.png](/t5/image/serverpage/image-id/160549iF4F7A46349547558/image-size/large?v=v2&px=999 "confluence search placeholders html.png")

In my opinion, this Confluence behavior is a bug and should generally be fixed. I would file a bug report, but I can't do that as a Confluence Server user.

Until then, is there any way to prevent placeholder text and HTML macro content to appear in search results in a space? (Apart from removing all of it, obviously, which isn't an option.)

Thank you.


Answers:
author: rvallieu
body: I find it very unfortunate that there isn't a built-in filter to exclude text found in HTML macros in the search results.


author: Philipp
body: Atlassian informed us that this issue has in fact been known for years, but they decided to not resolve it. This is a really unfortunate decision in my opinion. See [CONFSERVER-33208](https://jira.atlassian.com/browse/CONFSERVER-33208), which links to multiple similar issues. (They use the term "instructional text" for placeholders - that's why I originally didn't discover these issues.)


author: Philipp
body: Thanks for your answers. We did now create a support request to Atlassian, who will hopefully turn this into a proper bug ticket.


author: Christian B?hlmann
body: Dear Philipp  

Same issue here. We generate Confluence pages using a template engine (outside Confluence).

<br />

The templated content is irrelevant for users and does obstruct finding the actual content.  
Would love to see a feature to tell Confluence not to index certain elements of a page.

Did you already create an issue / feature request?

Cheers,  
bue


author: Dominic Lagger
body: Hi [@Philipp](/t5/user/viewprofilepage/user-id/4559869)

I just tested your case with placeholders (instructional text). And yes, I could reproduce this and yes, I think this is a bit strange.

But, I do not think, that there is any solution for this. I'm not aware, that you can exclude these things.

When you can not create an incident to atlassian support, try to ask your confluence admin to do that.

Regards, Dominic


Tags: confluence-server

search

server

template