How to hide the "Created By/Edited By" byline at the top of a page.

Is it possible to hide the "Page created by <user> and last edited by <user>" byline at the top of the page?


We've already created several scripts to hide other parts of the interface from anonymous users (thanks to this forum). But I haven't been able to find one for the byline at the top.

For example, here's the one we're using to hide the Browse menu. What's the equivalent for the byline (if possible)?

&lt;script&gt;
if (AJS.$('#login-link').is(":visible")) {
    AJS.$('#browse-menu-link').parent().hide();
}
&lt;/script&gt;

2 answers

1 accepted

2 votes

Try something like this:

&lt;script&gt;
AJS.toInit(function() {
AJS.$('.page-metadata').hide();
});
&lt;/script&gt;

Excellent. That did the trick perfectly.

How to do this in Confluence Cloud? Any workaround?

Personally, I think it's best to remove it at the source, rather than do this "post-processing" scripting. (Yes, I still use jQuery for a bunch of things, but this is one that's easy to eradicate without having to add to your custom HTML).

In your space's Page Layout decorator, comment out the following line:

#parse ("/decorators/includes/page-metadata.vm")

I like having some metadata, so I add this to the bottom of each page:

#set ($lastModder = $confPage.getLastModifierName())
#set ($lastModDate = $confPage.getLastModificationDate())
&lt;div class="page-metadata"&gt;
&lt;ul&gt;
&lt;li class="page-metadata-modification-info"&gt;Last edited by $lastModder on $lastModDate&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;

Matthew, you're right. That is probably a superior solution. I'm marking this as an accepted answer, because you've never lead me astray on any of my other questions, and nothing in that code looks out of place.

However, we've decided to go with the Documentation theme which restricts a lot of the customization options within Confluence. I can't test it.

With that in mind, we're okay with this (and the various other changes we've made) existing as a post-processing function. There's really no harm in any of these hidden functions being visible, we're just purusing as clean and straightforward layout as possible to present to as many of our anonymous users as possible. If someone disables Javascript and sees the metadata, that's okay.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Kesha Thillainayagam
Posted Apr 13, 2018 in Confluence

We want to hear how your non-technical teams are using Confluence!

Hi Community! Kesha (kay-sha) from the Confluence marketing team here! Can you share stories with us on how your non-technical (think Marketing, Sales, HR, legal, etc.) teams are using Confluen...

380 views 21 10
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you