We use cookies to make your viewing experience better. By accepting you consent, you agree to our Cookie policy

Accept
Improve your Craft CMS skills

A Guide To The Craft CMS SEO Plugin: Sitemap Creation

10 min read
Craft CMS seo plugin sitemap

Generating XML sitemaps can be a headache for Craft CMS sites. Without them, search engines struggle to properly crawl and index your content, hampering visibility. This guide will explore how the SEOmatic plugin eliminates sitemap pains. You'll learn the easy setup steps, configuration tips and troubleshooting tricks that make SEOmatic the ultimate sitemap solution for both new and experienced Craft users.

The SEOmatic plugin for Craft CMS offers easy XML sitemap generation and submission to search engines, with advanced configuration options for inclusion/exclusion of URLs, sitemap segmentation, priority optimization, and rich structured data like videos and hreflang. It eliminates sitemap headaches through automation and flexibility.

Getting Started with SEOmatic for Sitemaps

Installing the SEOmatic Plugin

The first step towards harnessing the power of SEOmatic for generating XML sitemaps is installing the plugin itself. Head over to the official Craft CMS plugin store and purchase a licence for the SEOmatic plugin.

SEOmatic offers both free and paid "Pro" versions, with added benefits like integration with Google Search Console in the paid edition. For most websites, the free plugin has all the core sitemap functionality needed though.

After purchasing, you'll gain access to a ZIP file containing the plugin files. Unzip this archive and copy the seomatic folder to /craft/plugins on your server. Now from your Craft CP, go to Settings > Plugins, click "Install" for SEOmatic and then choose to activate it.

With the plugin installed and activated, you're all set to start configuring its settings and unleash its sitemap superpowers! Just a few configuration tweaks and you'll have SEOmatic automatically generating XML sitemaps for your site in no time.

Activating and Configuring the Plugin

Once SEOmatic is installed, the next step is activating it and customising the settings. In your Craft control panel, navigate to Settings > SEOmatic to bring up the plugin's default options.

It's recommended to start by entering your site's default meta information like title, description and Twitter username. This saves you time, avoiding the need to repeat this for every single template and page.

Head to the Sitemap Settings section next. Here you can define the default priority and change the frequency for your sitemaps. Setting these to something like 0.5 and weekly is a good starting point.

The control panel allows activating SEOmatic for several key template types like pages, entries, categories and products. Check the relevant boxes to have sitemaps auto-generated for all your site's content.

Finally, under Advanced Settings, switch "Enable for entire site" on. This activates SEOmatic site-wide to keep your sitemaps updated across all templates. Hit save and you're ready for sitemap success!

Choosing Automatic or Manual Sitemap Building

One of SEOmatic's best features is giving you the choice between having sitemaps built automatically or generating them manually.

Using the "Sitemap Cron Job" section under Sitemap Settings, you can set a cron job to run on a chosen schedule that rebuilds your sitemaps. Daily, weekly or monthly are all solid options to ensure your sitemaps stay fresh.

Setting a frequent sitemap cron job takes the effort out of remembering to manually build your sitemaps. But for sites with infrequent content updates, manual building can work fine too.

To manually generate a sitemap, navigate to SEOmatic > Sitemaps in your Craft control panel. Simply click the "Generate a sitemap" button and your sitemap will be created on-demand.

The manual approach gives you full control to only build sitemaps when needed. But make sure you remember to generate them regularly after publishing new content or products.

For most sites, scheduling an automatic cron job is the best practice for effortless XML sitemap creation. But manually building works for sites with sporadic updates. SEOmatic caters to both approaches.

With the plugin installed and activated, meta info configured and sitemap settings tweaked, you've covered the key steps for getting up and running with SEOmatic. Keep your sitemaps building on autopilot and say goodbye to search engine crawl errors!

Configuring Sitemap Settings in SEOmatic

Selecting URLs to Include

A key part of configuring SEOmatic's sitemap generator is choosing which URLs from your site to include. The plugin gives you advanced options for fine-grained control over sitemap content.

By default, SEOmatic will include all public URLs it can find across your templates, entries and categories. But you may wish to narrow this down.

Under the Sitemap Settings, you can selectively enable SEOmatic for only certain sections of your site. Untick Pages, Entries, Categories, etc. to exclude those items from your sitemaps.

The "Additional Sitemap URLs" section lets you explicitly add or remove individual URLs. This is handy for including important pages like Contact or About Us that may not be entries.

You can also filter items by Channel. For example, you could output Products but exclude Blog Posts from your ecommerce site's sitemaps.

Overall, SEOmatic aims to maximise your sitemap coverage but gives you the flexibility to fine-tune inclusions based on your preferences and site architecture.

Setting Frequency and Priority

Search engines use the frequency and priority data in sitemaps to understand how often pages are updated and their relative importance.

Configuring these values in SEOmatic helps search bots better crawl and index your content. Pages you change weekly should use a higher frequency than static ones.

Don't rely only on priority and frequency though. Focus on publishing amazing content that users love - that will be your strongest SEO signal!

In your Craft SEOmatic settings, you'll find the default frequency and priority values under Sitemap Settings. Set the defaults to something like weekly and 0.5 to start.

You can override the defaults on a per-URL basis using SEOmatic's advanced Twig functions like seomaticSitemapPriority and seomaticSitemapChangeFrequency.

This lets you indicate certain pages as "daily" for frequency or "0.9" for your home page's higher priority versus standard site content.

Tuning these values takes some trial and error. Review your site's Google Search Console data for crawl stats and tweak as needed.

Adding Images, Videos and hreflang

Beyond basic URLs, SEOmatic supports rich XML sitemaps for images, videos and multilingual sites.

XML image sitemaps make life easier for Google Images. Enable the "Image Sitemap" setting and SEOmatic will automatically include images from assets fields!

Ditto for video sitemaps and your YouTube/Vimeo embeds or generic video content. Turn on "Video Sitemap" to enhance rankings and exposure.

For multilingual sites, hreflang tags indicate to search engines which pages serve which locales or regions. Check "Generate hreflang tags" so SEOmatic handles this for you.

One toggle enables hreflang generation for entire site sections. But you can also customise on a per-URL basis using seomaticHreflangTags.

Adding images, videos and hreflang data makes your sitemaps "richer" - and should in turn enrich your search visibility when indexed.

With SEOmatic's flexibility for fine-grained inclusions/exclusions, priority tweaking and rich enhancements like hreflang and media sitemaps, you wield total control over your sitemaps' contents and structure.

The plugin makes sitemap best practices convenient and accessible for everyone. Configure once, then let SEOmatic automate the technical complexity under the hood.

Structuring Your SEOmatic Sitemaps

Using Sitemap Indexes

For large sites with tons of pages, structuring your sitemaps wisely is key to proper indexing. This is where sitemap indexes come in handy.

A sitemap index is a special XML file that lists the individual sitemap files for your site. It allows breaking down one massive sitemap into logical chunks.

The index file then serves as parent, with search engines able to discover the child sitemap files through this central reference point.

In your SEOmatic settings, enable "Generate sitemap index files" under the Sitemap Settings. This tells the plugin to automatically generate an index.

You can also set a maximum URL limit per sitemap file. 50,000 URLs is a common guideline. SEOmatic will split up sitemaps once they exceed this threshold.

Without sitemap indexes, crawling extremely large sites efficiently poses challenges. But indexes make massive sites more accessible.

Google and Bing can traverse the sitemap index to discover the individual sitemap pieces, rather than one huge file.

Segmenting Your Sitemaps

Beyond sitemap indexing, further segmenting your sitemaps can also prove beneficial. This subdivision method complements indexing for large sites.

For example, you could have separate sitemaps for pages, blog entries, events and news items. Or split by site section like Products, Customer Stories, About Us.

In your SEOmatic config, disable the Singlesitemaps setting. This will generate multiple sitemaps rather than bundling everything into one file.

You can also leverage SEOmatic's template-specific settings to only output sitemaps for certain sections. Enable it only on templates/channels needing sitemaps.

Take care not to segment too aggressively though. Having 100 sitemaps from over-optimizing can cause crawl budget issues.

Aim for logical groupings that aid accessibility for search bots without going overboard. Monitor indexing metrics to tweak things.

Optimizing URL Paths and Priority

When structuring sitemaps, also consider URL paths and priority optimization tactics.

Try to avoid overly long URL paths where possible. Instead of:

/blog/category/news/2022/how-to-optimize-sitemap-xml

Do:

/news/optimize-sitemap-xml

Long paths can slow down crawling and indexing. Streamline things.

You can also strategically boost priority for key pages like category archives, the blog home, contact pages.

Set these to 0.8+ in SEOmatic rather than the default 0.5 priority.

Also consider dropping extremely low-value pages to 0.1 priority or excluding them entirely.

Run some tests to see if optimizing path length and priority settings improves your XML sitemap results. Monitor crawl stats and search performance.

By combining logical sitemap indexing, thoughtful segmentation and selective URL priority/path optimizations, you can maximize the SEO value of your SEOmatic sitemaps.

Aim for an optimal balance - not too many tiny sitemaps, but not a single ginormous one either. Segment and structure based on site size and search crawler needs.

Submitting Your Sitemaps to Search Engines

Downloading the Sitemap File

Once your SEOmatic sitemaps are generated, it's time to retrieve the XML file and submit it to search engines like Google and Bing.

In your Craft control panel, head to SEOmatic > Sitemaps. Here you'll find links to download your sitemap index file and any individual sitemap XML files. Right click the sitemap link and choose "Save As" to download the file to your computer. You'll then upload this file to search engine webmaster tools.

If using sitemap indexing, download the index file as this points search bots to all the individual sitemap XMLs.

You can also hit the "Regenerate this sitemap" button to force a fresh build of the sitemap before downloading.

This ensures you grab the latest XML with any new content changes that may not be reflected in the existing file.

With the sitemap XML downloaded, it's submission time!

Submitting to Google and Bing

To ensure search engines can discover and crawl your shiny new sitemaps, submitting them in Google Search Console and Bing Webmaster Tools is key.

For Google, log into Search Console and under Index > Sitemaps, choose "Add a new sitemap". Upload your sitemap index XML.

You can also provide the URL path to your sitemap index instead if you wish. This saves you downloading and uploading the file manually.

After adding the sitemap, Google will commence crawling and indexing the URLs within it. Monitor progress under Index Coverage.

Do the same for Bing Webmaster Tools, using the Sitemap upload tool under Site Configuration. Provide your sitemap index file or path.

Now Bingbot can consume your sitemap content too. Check back on the Submitted Sitemaps page to see indexing stats.

By submitting your sitemaps directly, you empower Google and Bing to discover your new and updated content faster.

Monitoring Indexing

It's good practice to check back on your major search engines' tools section regularly to monitor sitemap indexing progress.

As Google discovers and crawls the URLs within your sitemaps, you'll see these start to appear under Index Coverage.

Fluctuations here, such as a drop in indexed pages, can indicate an issue like crawl budget limitations or blocking from robots.txt.

Bing also shows you stats on crawled pages under Submitted Sitemaps. Keep an eye for any abnormal changes.

Indexing metrics empower you to diagnose and resolve any potential problems. Maybe a particular sub-sitemap is failing to get crawled.

You can also spot new content not getting picked up quickly enough. If so, try re-submitting the sitemap or pinging via GSC.

Don't obsess over indexing rates, but periodic checks help you stay informed. You want healthy crawl rates for SEO success.

By submitting your SEOmatic sitemaps directly to Google and Bing, monitoring the indexing results, and quickly addressing anomalies, you'll reap maximum SEO value from your XML sitemaps.

The creative work goes into publishing amazing content. Sitemaps simply showcase your content to search engines in a crawlable format.

Sitemap Monitoring and Troubleshooting

Auditing Sitemaps in Search Console

Even with SEOmatic handling the heavy lifting, it's wise to periodically audit your sitemaps within Google Search Console.

Under the Index Coverage report, click into Sitemaps and choose one to access detailed crawl stats.

Review the Indexing section for any errors like "Sitemap could not be read" or "Duplicate URL". Warnings for blocked or redirected URLs may also appear.

Click the Sitemap Errors tab for a comprehensive list of any issues Google's crawlers encountered. Missing or malformed URLs, HTTPS problems etc.

You can also check Index Status - URLs listed as Excluded may need tweaking. Is a noindex or password protection stopping indexing?

Running this audit highlights anything needing attention to ensure your sitemaps are perfectly optimized.

Identifying Issues and Fixes

Some common sitemap problems include:

Missing URLs - Double-check your SEOmatic template configuration to ensure all URLs are output.

Duplicate URLs - Adjust settings to prevent generating multiple instances of one URL.

Indexing blocked - robots.txt or meta noindex tags could be blocking crawl access.

Malformed URLs - Fix any invalid or broken URLs in your sitemaps.

For missing or duplicate URLs, revisit SEOmatic's sitemap settings - did you include/exclude something unintentionally? Add any missing URLs and disable doubles.

For indexing issues, check robots.txt and page noindex settings. Maybe the URLs appear but are blocked from actual indexing.

Fix any malformed URLs in your templates or content. Your sitemaps must only include valid, crawlable links.

Reconfiguring SEOmatic Settings

If your sitemap audits reveal systematic issues like large swathes of missing or duplicate URLs, adjusting your SEOmatic configuration is in order.

Double check what templates, channels and URLs are included/excluded. Disable sitemaps for any sections not needing them.

Review the Additional Sitemaps Settings for any potential conflicts with the main configuration. Remove unnecessary custom URLs.

You can also tweak things like @hideInSitemap annotations on specific entries that may be erroneously appearing.

For sites running multiple locales or domains, ensure your Multi-Site settings correctly output only one URL version.

Retest after tweaking settings and rescanning templates to see if issues remain. You want optimal accuracy in your sitemaps - no errors, no duplicates.

By regularly auditing in Search Console, swiftly identifying problems, and fine-tuning your SEOmatic configuration, you can eliminate sitemap defects for indexing success.

Stay on top of potential issues and don't neglect your sitemaps once initially set up. A little ongoing tweakment maximizes quality and SEO value.

Alternatives to SEOmatic for Sitemaps

Native Craft CMS Sitemaps

Craft CMS provides native XML sitemap generation out of the box. This offers a basic alternative to using a dedicated plugin like SEOmatic.

The native sitemaps output all public entries, categories and product pages automatically. But they lack advanced features like custom inclusions/exclusions or rich media sitemaps.

Native Craft sitemaps also don't segment large sites or utilize sitemap indexing. So for massive sites, SEOmatic offers smarter XML structuring.

However, for smaller sites not needing complex configuration, the native sitemaps may suffice. And you avoid installing another plugin.

If going the native route, be sure to manually submit your sitemaps to Google/Bing, as automatic submission must be handled via SEOmatic or another plugin.

Overall, SEOmatic delivers significantly more control and flexibility for customizing and optimizing your XML sitemaps. But native works fine for simple use cases.

Other Sitemap Plugins

The Craft plugin store offers a few alternatives to SEOmatic for sitemap generation:

  • Sitemap (simple, fast sitemap building)

  • Sprout SEO (sitemaps + other SEO tools)

  • Retour SEOmatic Fork (fork of SEOmatic)

These provide a middle ground between basic native sitemaps and advanced SEOmatic capabilities.

Sprout SEO is great for an all-in-one SEO toolkit. Retour's fork offers an alternative take on sitemap creation.

Evaluate each plugin's features and long-term support viability before choosing. Many still don't match SEOmatic's breadth.

If you just need simple XML sitemaps, the Sitemap plugin offers speedy builds without extra bells and whistles.

Custom Sitemap Implementation

Building a custom sitemap implementation in Craft is an option, but requires significant development work.

You'd need to handle building the XML, segmenting large sitemaps, cron job automation etc. yourselves.

This avoids plugin overhead and gives you ultimate control, but divert developer resources from other initiatives.

Evaluate whether it's worthwhile investing precious dev time into a custom solution vs leveraging an off-the-shelf plugin like SEOmatic.

For most sites, a plugin will satisfy requirements unless you have a truly exceptional use case.

In summary, SEOmatic remains the Cadillac solution for sitemap generation in Craft CMS. But alternatives like native sitemaps or other plugins work for simpler needs.

Custom development is an option but resource-intensive. For maximum flexibility and minimal friction, SEOmatic is hard to beat.

If this doesn't help you, and you're looking for an Agency to handle your Organic SEO efforts, get in touch with MadeByShape - they're amazing.

Shape April 2022 HR 202
Andy Golpys
- Author

Andy has scaled multiple businesses and is a big believer in Craft CMS as a tool that benefits both Designer, Developer and Client. 

Share
Feedback
Show us some love
Email Us
We usually reply within 72 hours
Agency Directory
Submit your agency
Affiliate Partners
Let's chat