@percy_bauch
Implementing canonical tags in a Ghost blog involves editing the theme's template files. Canonical tags are used to prevent duplicate content issues by pointing search engines to the preferred version of a URL. Here's how you can implement them in Ghost:
- Access Your Theme Files:
Download or clone your active Ghost theme from your Ghost Admin dashboard under Design > Change theme > Advanced > Download.
- Edit the post.hbs File:
Locate the theme file post.hbs, which is typically used to render individual blog posts. This is where you'll add the canonical tag for each post.
- Add Canonical Tag:
Open post.hbs and insert the following code inside the section:
This code generates a canonical URL for each post using Ghost's {{url}} helper to provide the absolute URL.
- Edit the page.hbs File (Optional):
If your blog uses custom pages, you should also add a canonical tag to the page.hbs template:
- Update Home and Any Other Pages:
If you're concerned about canonical tags for categories, tags, or other generated pages, update their respective .hbs files (index.hbs, tag.hbs, etc.) similarly.
- Upload and Activate Theme:
After editing, compress the theme folder into a .zip file and upload it back to the Ghost Admin panel under Design > Change theme > Upload theme.
- Test the Implementation:
Open your blog in a browser and use the view source feature to check if the canonical tag is correctly implemented in the section for individual posts/pages.
By following these steps, you will have added canonical tags to your Ghost blog, which should help in guiding search engines to index the preferred versions of your content.