Head Section
Contents
Head Section
The Head tool of BlockBuilder gives you access to the <head> section of your site's pages.
The head is the invisible part of your page (if you want to see it, view the source code in your browser) that holds...
-
the Title tag
-
Description meta tag
-
the reference to your CSS file that holds the styling code for your site
-
your page's OG (Open Graph) tags
-
other information that browsers need to know about your page to make it work properly for each visitor, but that your visitors don't need.
Why is this important? There are certain tags and scripts that should be added to the head to give your site more functionality, or to detail site ownership, or track traffic stats about your site.
The first section below discusses the types of code you can add to the head.
The remaining two sections discuss the Sitewide option and the per-page option for adding code to the head.
Get the Most Out of the Head Section Tool
Best Practices
The box for Sitewide may rapidly fill up with code, to the point that you will not be able to see everything.
Your browser has the option to expand the box by clicking and dragging on the bottom right corner of the box.
Or highlight all the code in the box, copy it, paste it into a text document, and add the newest code. Then highlight and copy the code, and paste it into the text box to replace the "old" code there.
When adding code, add a comment to remind yourself of what that code is for. Use this format...
<!-- Desc of the code that follows this comment -->
There are several types of code that need to go in the <head> section of your pages, or work best when placed there.
Custom CSS Files
If you have a special feature that you've added to your site, and it comes with its own CSS file, add a reference to the CSS file.
If this feature is on all pages, add the references to the Sitewide box. If it appears on just a few pages, add the reference to the This Page Only box for each of those pages.
Meta Tags
You can verify site ownership at Google Search Console and Bing Webmaster Tools by adding a tag to the head of the home page. Some other sites, such as Pinterest and Norton SafeWeb, also require verification.
For each of them, add the meta tag they provide to the head section of the home page. Add it to the This Page Only box when editing the home page.
Some specialty meta tags go in the Sitewide box. For example, if your site is for a local business, add meta tags that include your address, city, region, etc. See this TNT HQ article for details...
https://sbitips.sitesell.com/local-business-building-site.html
ShareThis Bar
If you want to use the ShareThis social media bar on your site, there's some code that goes in the head. Paste it into the Sitewide box to put it on every page of your site.
See the tip in the Sitewide section of the help (below) for what to do if you don't want the ShareThis bar on a particular page.
Specialized JavaScript Files
JavaScript lets you have elaborate functionality on your site. For example, show the current date and time on each page. Or add a widget that displays news about your niche.
Some of the JavaScript has to be placed where you want the functionality, while in other cases, it's referenced from a file you upload with Quick Upload It!, or from a file on another site.
To reference the uploaded or external file, add the line of code to the head of your pages using the Sitewide box. If the functionality appears on only a few pages, add it to the This Page Only box for each of those pages.
For more ideas on how to use this feature, as well as comments and other information, see this forum post. With so many excellent contributions, it was invaluable to our development of this feature. It should give you some great ideas for extending the functionality of your website.
Sitewide
- Type or paste in the code that will appear in the head section of every page of the site.
- If the code should not appear in the head of a page, uncheck the Include this code on this page box when building or editing the page.
- Click on Add to the Head to save the code.
The Sitewide option works the same way as a Sitewide Dot works on your pages. Type or paste code into this box to have it appear on every page of your site.
However, there's some code that you might not want on some pages. In a Sitewide Dot, you would click on the red – symbol to "hide" the content on that page.
To do the same thing for the head section, uncheck the box that says Include this code on this page.
Tip
-
If you don't want some of the code in the Sitewide box, but you do want or need the balance, uncheck the box, then copy the code you want or need and paste it into the This Page Only text box. That will ensure that you don't lose the functionality or service you need.
This Page Only
- Type or paste in any code that should be in the head section of only this page.
- Click on Add to the Head to save the code.
The This Page Only box allows you to add code on a per-page basis.
This will most commonly be used for the home page, which typically has ownership verification tags and other one-time-only code.
Type or paste in all the code you need to have on the current page and only this page.
That includes any code that might be in the deactivated Sitewide box (discussed above) that you still need to have on the page.