Hide “+ New Discussion” link on Discussion Board Web Part

Discussion Board Web Part

At this company I worked at, we had an anonymous suggestion box that was submitted through an honest broker. We wanted to disseminate the submissions to the company, and allow the managers/leadership to respond to them, but have a buffer between the live submissions (in the case that someone submitted a profanity-ridden rant about another employee, etc.)

The end result was that they wanted to utilize the discussion board to show the results, but didn’t want employees to be able to easily submit posts to the discussion board.

We basically needed to hide the “Start a new discussion” link on the discussion board webpart. Easy enough, right? Kind of… There are 5 views on the discussion board that you can navigate through, so you have to enter 5 different snips for each view to remove the link. Here’s how.

The element we need to hide is called  #forumX-NewPostLink — where X is the view you’re looking at, 0-4.  Set the display property to none, and you’re all set.

Want to hide it?

Drop this code in:

<style>
#forum0-NewPostLink{
display:none;
}
#forum1-NewPostLink{
display:none;
}
#forum2-NewPostLink{
display:none;
}
#forum3-NewPostLink{
display:none;
}
#forum4-NewPostLink{
display:none;
}
</style>

This article applies to other web parts too!  Play around with the “developer mode” of your favorite browser, find the ID of the element, and turn it off!