Skip navigation
1
Apr 08 2008

TYPO3 SEO removing comments

As I’m somewhat picky about the code produced on my sites I was really keen to remove the comments describing each TYPO3 content element. This is the sort of thing I mean:

<!--  CONTENT ELEMENT, uid:122/textpic [begin] -->
<a id="c122"></a>
<!--  Header: [begin] -->
<div class="csc-header csc-header-n1">
<h2 class="csc-firstHeader">
Time-served Designer & Webmaster available for challenging permanent positions and short-term contracts.
</h2>
</div>
<!--  Header: [end] -->
<!--  Image block: [begin] -->
<div class="csc-textpic-text">
<!--  Text: [begin] -->...

The simple addition of this TypoScript snippet in the Setup of the root template disables comment output for a cleaner source:

?View Code TYPOSCRIPT
config.disablePrefixComment = 1

Here are the new results:

<a id="c122"></a>
<div class="csc-header csc-header-n1">
<h2 class="csc-firstHeader">
Time-served Designer &amp; Webmaster available for challenging permanent positions and short-term contracts.
</h2>
</div>
<div class="csc-textpic-text">...

Note that the following TYPO3SEARCH comments are unaffected by the tweak and require hacking the source file of Templavoila.

<!--TYPO3SEARCH_begin-->
<!--TYPO3SEARCH_end-->

You can learn how to remove the TYPO3SEARCH comment here.
The typo3pwnage site has ceased to exist – my advice is leave the TYPO3SEARCH comments alone as you’ll need them to implement site search.

1 response so far ↓

Leave a Comment