"Hiding" would be a better way of describing what I'm about to say, since "Removing" will make SharePoint not render properly.

In other words, I do not recommend removing any Content Place Holders from SharePoint master pages. I recommend turning them off.

So let's say that you need to hide or remove the Search area from a SharePoint site.

Using SharePoint Designer, open your copy of the v4.master master page.

Locate the following piece of code:
If you have still never made changes to your copy of the v4.master master page, the lines of code I'm talking about go from line 330 to 337.

Tip: Using SharePoint Designer Split View, select the Search box in the lower Design frame and SharePoint will highlight the code in the upper Code frame.

Delete what you don't need. For most of my projects, I delete the entire <div>, starting with the <div id="s4-searcharea" class="s4-search s4-rp"> all to the closing </div> right after the </span>.

Go to the bottom of the Master Page in the Code view.  Locate the following lines of code:


Insert a couple of lines right above the closing </form> tag and type the following:

<!-- Lines below added for unused Content Place Holders -->

    <asp:panel visible="false" runat="server">
        <asp:ContentPlaceHolder id="PlaceHolderSearchArea" runat="server" />
    </asp:panel>

<!-- End added lines for unused Content Place Holders -->


Save, check in, and publish your master page. Go to the browser and test to see how it looks.


Your comment will be posted after it is approved.


Leave a Reply.