No one has responded to this discussion for at least a year, so this information may be out of date. If you're looking for information about this topic, please search for a more recent discussion or post a new question.

Editing HTML <head>

This question is answered This question is answered

Please could you advise how I edit the HTML code of my website directly.  I know this can be done using sharepoint designer but I cannot see where to edit the <head> specifically. 

Verified Answer
  • stebutty,

    I said you can't edit the root.master but since analytics code can go anywhere on a page you don't need to. 

    JoeF,

    You can't edit the default site designer built pages in "design" mode in SPD. But if you want to add things like Google Analytics, you can paste the code in using "code" view. If you want it in the <head> section, paste it right before the closing "<head> tag.

    I haven't tried Adrian Fiechter's solution but he's come up with some other brilliant workarounds so it can't hurt to try.

All Replies
  • Hi Stebutty,

    This is Jonis from Microsoft Online SharePoint Support.

    The quickest way to change your website header is to use the built in Office 365 Web Design tool.  To make simply changes, form the Web design Tool, just click on the header and edit from there.

    To change the header from the Cascading Style Sheet (CSS), first make sure that you download SharePoint Designer 2010 32-bit.  This is a free tool for Office 365 customers.  Use the following link to Download SharePoint Designer 2010 32-bit.

    The following links detail customizing the Cascading Style Sheet (CSS) in SharePoint Online with SharePoint Designer 2010:

    Customizing SharePoint Online with SharePoint Designer 2010

    SharePoint Online Branding

    Customizing SharePoint Online Using SharePoint Designer 2010

    If that does not answer your question please let me know as I will continue to monitor this thread for a few days and will reply to any additional posts or questions.

    0 out of 2 people found this post helpful.

  • I want to add some custom HTML code to the <head> section of the page.  I'm fully aware of how to edit the design already.

    1 out of 1 people found this post helpful.

  • It depends what you want to add. The <head> section is just a way to conveniently add code to every page and has no other special significance - the code will work the same anywhere on the page. Meta tags and so on can be added through the editor (properties>>seo box); for things like Google Analytics, open the site in Sharepoint Designer and add it right before the </head> tag. Ideally this would be done in the root.master but MSFT has rigged that to disallow changes. 
  • I want to add a google analytics code into the head yes.  I tried doing it in the root.master but the site was not accessable after I did this?  Any other ideas?  

  • @stebutty

    sorry to jump in on this topic here, I should start a new one but looking before I could not see anyone had succeeded in editing the public site using SP2010. Have you actually managed to edit the public facing site using sharepoint designer 2010? I can't get either "Design" or "Split" mode to work. "Code" is just one long line of code......

  • On the Google Analytics, has anyone attempted the solution here: www.fiechter.eu/.../Post.aspx I have not tried myself, does it embed the code into all the site pages I wonder?

  • stebutty,

    I said you can't edit the root.master but since analytics code can go anywhere on a page you don't need to. 

    JoeF,

    You can't edit the default site designer built pages in "design" mode in SPD. But if you want to add things like Google Analytics, you can paste the code in using "code" view. If you want it in the <head> section, paste it right before the closing "<head> tag.

    I haven't tried Adrian Fiechter's solution but he's come up with some other brilliant workarounds so it can't hurt to try.

  • mchv2.0 until I have some confidence in being able to make a back up the site myself, not sure I want to try [but heartened by "brilliant workarounds"]. Not sure I want to rely on 365 saying they can deal with restoring the site since the back up option in OLSB has gone.

  • Joe,

    If it isn't too big, you can try saving the site as a template from the top level site settings>>site actions. Trouble is unless you have a spare account you can't test out if the restoration is going to work. If it's important enough to you, you could always sign up for another trial account and try it. A site template will be a wsp file (solution) so you'd download it from the solutions gallery and then upload it there and activate in the other account.  

  • thanks again for the help, I'll try that out