SEO-Saurus - Real-time development and web experiments
seo-saurus

Setting Up the Blog: Saurus Chronicles

On October 11th, 2024, I officially integrated the first blog into SEO-Saurus. My initial plan was to use TYPO3's built-in news extension, but unfortunately, it’s not yet fully compatible with TYPO3 v13. So, I had to make a tough decision: either build custom blog functionality or use static pages for blog posts.

In the end, I chose the more complex option—creating a custom "news-like" extension. While it’s harder up front, it will pay off later by giving me more control and flexibility. Plus, when the news extension is updated, I can easily convert or adapt my custom setup.

Step 1: Setting Up Blog URLs

Next on the list was configuring nice URLs for individual blog posts. TYPO3 has managed this manually since version 9, using the routeEnhancers feature in the site configuration. Here’s the code snippet I used to set up clean URLs for blog posts:

routeEnhancers:
Blog:
type: Extbase
limitToPages:
- 9
extension: HdBlog
plugin: Blog
routes:
- routePath: '/{post}'
_controller: 'Blog::singlePost'
_arguments:
post: post
aspects:
post:
type: PersistedAliasMapper
tableName: tx_hdblog_domain_model_post
routeFieldName: slug

This allows me to have SEO-friendly URLs for each post on SEO-Saurus, a critical step for both user experience and search engine visibility.

Step 2: Enhancing SEO

With the URLs set, I moved on to the SEO side of things. I installed TYPO3’s built-in SEO extension, enabled it through TypoScript, and immediately benefited from features like automated sitemap generation.

However, I wanted more control over my sitemap to ensure that blog posts were also included. Here’s the setup I used to generate a custom XML sitemap for blog posts:

plugin.tx_seo {
config {
xmlSitemap {
sitemaps {
posts {
provider = TYPO3\CMS\Seo\XmlSitemap\RecordsXmlSitemapDataProvider
config {
table = tx_hdblog_domain_model_post
sortField = publish_date
sortDirection = desc
lastModifiedField = tstamp
pid = 7
url {
pageId = 9
fieldToParameterMap {
uid = tx_hdblog_blog[post]
}
additionalGetParameters {
tx_hdblog_blog.controller = Blog
tx_hdblog_blog.action = singlePost
}
}
}
}
}
}
}
}

With this configuration, I ensured that each blog post gets listed in the sitemap. Once this was done, I grabbed the sitemap URL (seo-saurus.com/sitemap.xml) and submitted it to Google Search Console for indexing. Google quickly scanned my site and found eight URLs. Knowing that Google was actively crawling my site was a big win.

Step 3: Optimizing Robots.txt

To fine-tune which pages and directories are crawled by search engines, I added a robots.txt file with this syntax:

User-agent: *
Allow: /

# folders
Disallow: /typo3/
Disallow: /typo3conf/
Allow: /_assets/
Allow: /typo3temp/

# parameters
Disallow: /*?id=* # non speaking URLs
Disallow: /*cHash # no cHash
Disallow: /*tx_powermail_pi1 # no powermail thanks pages
Disallow: /*tx_form_formframework # no forms

# sitemap
Sitemap: https://seo-saurus.com/sitemap.xml

This robots file ensures that Google focuses on the important parts of my site and avoids indexing unnecessary URLs or parameters

Step 4: Setting Up a 404 Page

Lastly, I created a fun 404 page for users who land on broken links or mistyped URLs. This "Extinct Page" adds a playful touch, in line with the dinosaur theme of SEO-Saurus.

TYPO3 news extension

TYPO3 most often used extension for creation of blog posts, news systems etc. - News system from Georg Ringer

TYPO3 Search Engine Optimization

TYPO3 most often used extension for seo optimization, and sitemaps. - TYPO3 Search Engine Optimization from TYPO3 core

Comments

Follow me