---
title: "Sitefinity Development: Content Placeholders"
description: When developing in Sitefinity, it is best to ensure there are never content placeholders in the head tag.
image: https://www.inalign.com/hubfs/BlogSitefinity/sf-hero-development-blue.jpg
---

<https://www.inalign.com>

- [About](https://www.inalign.com/about-us)
- [Code](https://www.inalign.com/custom-development)
- [Sitefinity](https://www.inalign.com/sitefinity-development)
- [Blog](https://www.inalign.com/sitefinity)
- [Contact Us](https://www.inalign.com/contact-us/)

# Sitefinity Development: Content Placeholders

by [Stephen Horn](https://www.inalign.com/sitefinity/author/stephen-horn) Feb 24, 2015

Developers, I'm here to tell you Visual Studio really is a great tool.  The Telerik Sitefinity team(s) have embraced it and written some great plug-ins for it; [Thunder](http://docs.sitefinity.com/sitefinity-thunder-automate-you-development) is one such example.  One of the reasons I love Visual Studio is it has so many great shortcuts, that help productivity. But if we are not careful, a few of these shortcuts can lead to long term maintenance issues if not understood. One such example is the default master file structure, specifically, defaulting to putting a content placeholder (CPH) in the head tag.

Why is this such a big deal?  Why would I write a blog on this topic?  Why would anyone put a CPH in the head tag anyways?  Let me answer them in reverse order.  

The answer to why anyone would put a CPH in the head tag is, "I don't know."  Perhaps in some design patterns this makes sense. What I DO know, however, is that in Sitefinity development, it does not, and in fact it can hurt!  I write this blog because the best lessons in life come from failure; we hurt, but we learn.

Recently, during a migration on a site I was not that familiar with, I made a change to a master page that I thought was a sound one and that I was sure I could quickly resolve by then editing just two templates. But what I found when I got to the templates was that the controls I wanted to move were gone!  Because I know better, and I never put CPHs in the head tag, I had not thought to ensure there were none in this master page before failed notice a CPH in the head tag. So why is it such a big deal in Sitefinity Development?

![cph-1](https://www.inalign.com/hs-fs/file-2529898988-png/BlogSitefinity/ContentPlaceholders/cph-1.png?width=600&name=cph-1.png)   
**   IMG: Default Visual Studio Master Page**

The short answer should make this obvious: If the master file of an existing template/page is modified, and a contentplaceholder is removed, then any Sitefinity controls that existed in that CPH will be placed in the **first content placeholder in the flow of the master page**! I think you can quickly see where this leads. If the first contentplaceholder is in the head tag then this is where Sitefinity will 'shelter the homeless controls'.  You just spent so much time creating all of those nifty [Shared Content Blocks](https://www.inalign.com/sitefinity/sitefinity-cms-create-use-shared-content), so why would you want to lose them? You wouldn't of course, hence this blog post, to ensure you don't!

![cph-2](https://www.inalign.com/hs-fs/file-2528752996-png/BlogSitefinity/ContentPlaceholders/cph-2.png?width=600&name=cph-2.png)   
**   IMG-2: Something odd, only one content placeholder showing!**

![cph-3](https://www.inalign.com/hs-fs/file-2528753001-png/BlogSitefinity/ContentPlaceholders/cph-3.png)   
**   IMG-3: Let's add content anyway...**

![cph-4](https://www.inalign.com/hs-fs/file-2529898993-png/BlogSitefinity/ContentPlaceholders/cph-4.png)   
**   IMG-4: Oops! Someone removed the content placeholder in the master file!**

Okay, so you will not actually lose them, you will just have to find some creative ways to get them back! Since Sitefinity doesn't give you access to the CPH in the head, just edit the master file and move it to just after the opening Body tag.

**Note:** If you still have the editor open, and you undo your change, as long as the CPH still has the original ID, your template/page will self-correct. This is at least true of SF 7.x and later.

Certainly sound design helps to prevent all of this jumping through hoops, and most likely you weren't considering putting a CPH in the head tag anyway, but it's still something to keep this in mind anyway as you might one day find yourself working with a project in which you were not the original designer. Often the original developer wasn't being malicious, or even careless; he may simply be the victim of using the tools that are supposed to help!  Don't be a victim; keep content placeholders out of the head tag when working with Sitefinity!

[![New Call-to-action](https://no-cache.hubspot.com/cta/default/413787/1646b35e-3dff-416d-998c-5a177afe9208.png)](https://cta-redirect.hubspot.com/cta/redirect/413787/1646b35e-3dff-416d-998c-5a177afe9208)

### Related Posts

[![10 Sitefinity Features Marketers Can Easily Use with Any Website](https://www.inalign.com/hubfs/Inalign_March2018/Layout/sitefinity-background-supercharge-4.jpg)](https://www.inalign.com/sitefinity/10-sitefinity-features-marketers-can-easily-use-with-any-website)

[10 Sitefinity Features Marketers Can Easily Use with Any Website](https://www.inalign.com/sitefinity/10-sitefinity-features-marketers-can-easily-use-with-any-website)

[![What PHP Developers Need to Know When Working With Sitefinity](https://www.inalign.com/hubfs/BlogSitefinity/sf-hero-plain-sf-people-at-computers-blue.jpg)](https://www.inalign.com/sitefinity/what-php-developers-need-to-know-when-working-with-sitefinity)

[What PHP Developers Need to Know When Working With Sitefinity](https://www.inalign.com/sitefinity/what-php-developers-need-to-know-when-working-with-sitefinity)

[![Running Sitefinity Locally Within IIS on Windows 10](https://www.inalign.com/hubfs/BlogSitefinity/sf-hero-plain-charts-blue.jpg)](https://www.inalign.com/sitefinity/running-sitefinity-locally-within-iis)

[Running Sitefinity Locally Within IIS on Windows 10](https://www.inalign.com/sitefinity/running-sitefinity-locally-within-iis)

[![Speeding Up Sitefinity Development: Inline Editing](https://www.inalign.com/hubfs/BlogSitefinity/sf-hero-development-blue.jpg)](https://www.inalign.com/sitefinity/speeding-up-sitefinity-development-inline-editing)

[Speeding Up Sitefinity Development: Inline Editing](https://www.inalign.com/sitefinity/speeding-up-sitefinity-development-inline-editing)

[![Solution to the Sitefinity Error: The located assembly's manifest definition does not match the assembly reference.](https://www.inalign.com/hubfs/BlogSitefinity/sf-hero-crash-org.jpg)](https://www.inalign.com/sitefinity/sitefinity-error-assembly-manifest-does-not-match)

[Solution to the Sitefinity Error: The located assembly's manifest definition does not match the assembly reference.](https://www.inalign.com/sitefinity/sitefinity-error-assembly-manifest-does-not-match)

[![How to Customize Module Builder Widget Templates with Conditional Statements](https://www.inalign.com/hubfs/BlogSitefinity/sf-hero-plain-charts-orange.jpg)](https://www.inalign.com/sitefinity/how-to-customize-module-builder-widget-templates-with-conditional-statements)

[How to Customize Module Builder Widget Templates with Conditional Statements](https://www.inalign.com/sitefinity/how-to-customize-module-builder-widget-templates-with-conditional-statements)

[More](https://www.inalign.com/sitefinity/topic/sitefinity)

---

### Subscribe to Our Blog

---

### Topics

- [Main Blog](https://www.inalign.com/blog)
- [Sitefinity](https://www.inalign.com/sitefinity)

---

[![5 Conversion Killers Every Marketer Should Avoid](https://no-cache.hubspot.com/cta/default/413787/80197558-1902-4342-bb36-b0d3da7222ec.png)](https://cta-redirect.hubspot.com/cta/redirect/413787/80197558-1902-4342-bb36-b0d3da7222ec)

## This Post Was Written by Stephen Horn

### About Inalign

[Visit Inalign.com](https://www.inalign.com)

### Visit Us On LinkedIn

[Visit LinkedIn](https://www.linkedin.com/company/inalign-inc)

### Check Out Our Portfolio

[Visit Portfolio](https://www.inalign.com/Portfolio/portfolio-home/)

### Get a Free Assessment

![inaligngraylogo](https://www.inalign.com/hs-fs/file-1175323414-png/Inalign/Images/inaligngraylogo.png)

## 800.602.9947

- [Code](https://www.inalign.com/custom-development)
- [Sitefinity](https://www.inalign.com/sitefinity-development)
- [Blog](https://www.inalign.com/sitefinity)
- [About](https://www.inalign.com/about-us)

## ABOUT INALIGN

Inalign is a full stack Software Development firm specializing in building web and line of business applications. We focus on .NET, Angular, SQL Server, and Sitefinity.

We’ve worked with 300+ customers on thousands of projects for over 20 years!

## FOLLOW INALIGN

[![twitter_icon](https://www.inalign.com/hs-fs/file-1175323379-png/Inalign/Images/twitter_icon.png)](http://twitter.com/inaligninc)[![linkedin_icon](https://www.inalign.com/hs-fs/file-1175323409-png/Inalign/Images/linkedin_icon.png)](http://www.linkedin.com/companies/inalign-inc)[![facebook_icon](https://www.inalign.com/hubfs/Inalign/Facebook_Icon.png)](https://www.facebook.com/pages/Inalign-Inc/171479400405)