Build a free XML sitemap generator for your blog
Running a blog means juggling writing, publishing, and the unglamorous work of telling search engines what exists on your site. For plenty of creators in Australia, that last task still lives in a spreadsheet: a list of post URLs copied one by one into a text file, uploaded through an FTP client, and never checked again. A purpose-built XML sitemap generator removes the copy-paste, and it can run at zero cost if you host it on a platform with a free tier or on the shared hosting you already pay for.
This guide covers how to create a free XML sitemap generator tool for bloggers, from collecting URLs out of a WordPress install or a static site to formatting valid XML, hosting the file, refreshing it on a schedule, and submitting it to Google Search Console and Bing Webmaster Tools. It suits bloggers selling digital products, running affiliate sites, or helping small businesses around Melbourne, Brisbane, or Perth get their pages found. Readers who prefer a guided path can start with the free courses on VTU Script, then return here to adapt the code to their own host.
Why XML sitemaps still matter for blogs
Search engines discover pages in two ways: by following links and by reading your sitemap file. A sitemap is a simple XML document listing every URL you want considered for indexing, with optional metadata such as the date a page last changed. It does not hand out rankings. It solves a different problem, which is discovery, and that problem matters most on brand-new blogs where a handful of internal links are all a crawler has to go on.
Crawl efficiency is the practical benefit. When Googlebot already knows the complete URL list, it spends less time guessing and more time fetching. For a local business blog — a Sydney accountant, a Gold Coast gym, a Hobart bakery — that can mean pages buried three clicks deep get crawled within hours of publishing instead of days. It also gives you a second submission channel when a page vanishes from the index with no obvious cause.
Metadata is where a sitemap earns its keep. Accurate lastmod values help search engines decide when to revisit a page, which is useful for seasonal content that changes every Australian winter. Sitemaps also feed reporting tools: Search Console's index coverage report shows which submitted URLs were indexed, so you can spot stale or duplicate entries quickly.
Keep expectations honest. A sitemap tells Google what to look at; it does not replace good internal linking, clean URLs, or content people actually want to read. Treat it as a map handed to a visitor, not the destination itself.
Choosing a free platform to run the generator
Four realistic approaches keep a generator running without a monthly bill. A PHP script on existing shared hosting is the simplest, since most cPanel plans include cron jobs and PHP support. A static script committed to GitHub and rebuilt through GitHub Actions costs nothing beyond a free account. Cloudflare Workers give you a fast global endpoint with a generous free tier. Google Apps Script suits people who already live inside Google Sheets.
Each option suits a different skill level. PHP suits a blogger who can upload a file and paste a crontab line. GitHub Actions suits someone comfortable with YAML. Workers suit a developer who wants an API endpoint that returns fresh XML on request. Apps Script suits a marketer who wants to trigger a rebuild by clicking a cell and keep the URL list in a spreadsheet they can edit by hand.
Choose deliberately, because the real cost of a free platform is time rather than money. Free tiers also carry limits worth checking: request quotas, execution time caps, and storage ceilings on generated files. A blog with eight hundred posts fits inside every one of them, but a large e-commerce catalogue with thousands of product variants in AUD pricing may need a different plan.
Collecting the URLs your blog needs indexed
The generator needs a source of truth. On WordPress, the cleanest source is the REST API at /wp-json/wp/v2/posts, which returns published posts with their canonical link and modified timestamp. Page through it with a simple loop and stop once the response comes back empty. Plenty of hosts disable the REST API for security reasons, so confirm it responds before you build around it.
On a static site built with Hugo, Jekyll, Astro, or Eleventy, the source is usually the build output. Read the generated files or your content folder, then map each entry to its published URL. If posts live in a feed, the RSS or Atom feed is another quick source, though remember to convert feed URLs into the website URLs that match your canonical tags.
Whatever the source, clean the list. Drop URLs containing query strings such as utm_medium parameters or search filters. Exclude pages marked noindex, tag archives, author archives, and pagination links. Remove anything that redirects, along with soft 404 pages that return a 200 status but show nothing useful. Normalise the rest: force https, strip duplicate trailing slashes, and keep one version of each page. A sitemap full of near-duplicates tells search engines your site is bigger than it is, which muddies your own reporting.
Writing sitemap XML that search engines accept
The structure is short. A urlset root element wraps one url element per page, and each holds a loc, a lastmod, and optionally changefreq and priority. Format dates in ISO 8601, and because Australia swings between AEST and AEDT, store timestamps with an explicit offset rather than a bare local time so daylight saving never makes a page look newer or older than it is.
Use the tags you genuinely mean. Google largely ignores changefreq and priority, so publishing a priority of 0.9 for every post adds noise without signal. An accurate lastmod and little else is usually the stronger choice. If images matter for image search, a separate image sitemap gives you another route into Google Images, which Australian retailers and recipe bloggers rely on heavily. If you also serve readers in New Zealand, hreflang annotations in your page markup help both audiences get the right regional page.
Watch the limits. A single sitemap file can hold 50,000 URLs or 50MB of uncompressed XML, whichever arrives first. Past that, generate a sitemap index pointing to several numbered child files. For a large catalogue, split by type — posts, pages, product categories — so you can submit and troubleshoot each group separately.
Escape your data properly. An ampersand inside a URL becomes & in the XML, and a stray angle bracket breaks the parser outright. Write with a library that handles escaping for you rather than concatenating strings by hand. Save the result as UTF-8 and validate it before pointing any traffic at it.
Automating regeneration and keeping the file fresh
Set the job to run nightly, because a stale sitemap helps nobody. On shared hosting, add a cron entry that calls your PHP script and writes output into the public folder. On GitHub, a scheduled Actions workflow can rebuild and push the file to a Pages branch. On Workers, enable cron triggers for a scheduled event handler. In Apps Script, a time-driven trigger does the same job and can email you a copy of the new file.
Serve the file with sensible headers. Let crawlers cache it for a few hours so you are not regenerating on every request, and keep a consistent filename such as sitemap.xml so you never fragment your submission history. When you rewrite the file, replace it atomically so a crawler landing mid-write does not receive half a document.
Monitoring closes the loop. In Search Console, compare submitted URLs against indexed URLs and check the coverage report for errors like duplicate canonicals or blocked pages. Run an occasional curl command against your live file and confirm it returns a 200 status with the right content type. A sitemap that starts returning 404 after a hosting migration is a common and entirely avoidable problem.
Comparing free sitemap options for Australian bloggers
Cost matters here, and for Australian creators it usually arrives as a small monthly charge in AUD rather than a large one. Some paid tools add 10% GST at checkout, while free self-hosted options avoid the accounting entirely. The comparison below looks at approaches that genuinely cost nothing, what each suits, and where each one strains.
| Option | Cost | Best suited to | Automation | Main limitation |
|---|---|---|---|---|
| Hand-built PHP script on shared hosting | Free | WordPress blogs on cPanel | Cron, nightly | Requires comfort with PHP and crontab |
| WordPress plugin such as Yoast or Rank Math | Free tier | Non-technical WordPress owners | Automatic on save | Depends on plugin updates and host security |
| GitHub Actions plus static site build | Free | Hugo, Astro, Jekyll, Eleventy | Scheduled workflow | Static sites only; needs a repository |
| Cloudflare Worker endpoint | Free tier | Developers wanting an API | Cron trigger or on request | Free request quota; cold starts |
| Google Apps Script with a trigger | Free | Spreadsheet-driven workflows | Time-driven trigger | Awkward for very large URL lists |
| Paid SaaS generator | A few dollars a month | Large catalogues and agencies | Scheduled cloud jobs | Recurring cost; GST usually applies |
Choose on fit rather than feature count. A Melbourne cafe blog with forty posts needs a plugin more than a Worker, while a large Sydney fashion store with thousands of product pages may justify a subscription once GST is included and a paid organisation budget sits behind it.
Practical steps to launch your free sitemap generator
Keep the first version narrow so it survives contact with real blogs.
- Pick one data source and one platform, and resist adding a second until the first runs reliably for a week.
- Output one canonical URL per page with an accurate ISO 8601
lastmod, and drop everything marked noindex. - Schedule a nightly rebuild, cache the file, and confirm it still returns a 200 status after every deploy.
- Add the sitemap address to
robots.txtand submit it in Search Console and Bing Webmaster Tools the same day it goes live. - Review index coverage monthly and prune URLs reporting errors, redirects, or duplicates.
Build it over a long arvo this weekend rather than next quarter. Write the generator, deploy it, submit the file, and watch the coverage report in Google Search Console as your first posts get indexed. VTU Script carries practical guides on search fundamentals and script installation, and the community forum is the place to post your code when a host blocks something unexpected. Start with a single WordPress install, get one valid sitemap file served from your own domain, and the rest of the setup turns into routine maintenance you can schedule once and forget.