Technical SEO
Crawl Budget Optimization, Without the Guesswork
Crawl budget optimization is the work of making sure search engines spend their limited requests on pages that matter. In my WordPress and PHP builds that means reading server logs to see real crawler behaviour, collapsing parameter-driven URL duplication, keeping XML sitemaps accurate, and holding important pages within a few clicks of the home page. It is a maintenance discipline, not a one-off setting.
What crawl budget is, and when it actually matters
Crawl budget is the number of URLs a search engine is willing to fetch from a host in a given period, shaped by crawl limit and crawl demand. Crawl limit is the capacity Googlebot assigns to your server based on response speed and stability; crawl demand is how often your pages change and how valuable they appear. For a brochure site with fifty pages this is rarely the constraint. For a WooCommerce catalogue with fifty thousand variations, or a publisher adding hundreds of URLs a day, it is the difference between new products getting indexed this week and getting indexed next month. I treat crawl budget optimization as a way to remove wasted requests so the requests you already have land on pages that earn impressions.
- Crawl limit reflects how fast and reliably your server answers
- Crawl demand rises when pages change often or earn clicks
- Large catalogues and fast-growing archives feel the constraint first
- Small sites usually gain more from clarity than from throttling
Read the server logs before changing anything
Search Console's Crawl Stats report shows aggregated request volume, average response time and the bytes served, but it cannot tell you which template generated a 404 or which query string is burning requests. Raw access logs can. I look at the combined log format from nginx or Apache, filter for Googlebot and the other bots I care about, then group by status code, path and query string. Tools like GoAccess give a quick view; an awk or PHP script over a Cloudflare or nginx log gives the precise one. The signals I want are repeated fetches of filtered URLs, soft 404s returning 200, redirect chains costing two or three hops, and any bot request that takes longer than a second to answer.
- Filter by Googlebot, Bingbot and the AI crawlers you want citing you
- Group requests by status code, template path and query string
- Flag soft 404s that return HTTP 200 on an empty results page
- Measure response time per template, not just site-wide averages
- Verify bot IPs through reverse DNS before trusting a user-agent string
Parameter handling without breaking the site
Query parameters are the most common source of wasted crawl requests on a WordPress store. Faceted navigation, sort orders, tracking parameters and session IDs can turn one product category into thousands of near-identical URLs. Parameter handling has to be deliberate. I canonicalise every filtered view to the clean category URL with rel=canonical, emit the canonical in wp_head before any tag manager runs, and make sure the visible page agrees with it. For parameters that should never be crawled, a narrow robots.txt Disallow on the exact pattern is acceptable, but robots.txt cannot remove a URL that is already indexed; a noindex meta tag on the rendered HTML does. I avoid blanket rules that also block legitimate pagination or AJAX endpoints.
- rel=canonical on filtered views, pointing to the clean category URL
- robots.txt Disallow only on exact parameter patterns you have verified
- noindex on the rendered page for URLs that must leave the index
- Internal links that use clean URLs, never utm-tagged anchors
- Keep pagination crawlable and self-canonicalising
Sitemap hygiene: accuracy over completeness
An XML sitemap is a hint list, not an indexation guarantee. Its value is the signal it sends about which URLs you consider canonical and current. I generate sitemaps from the same query that publishes the page: only public, indexable, HTTP 200 URLs with a self-referencing canonical. Redirects, 404s, noindex pages, archive pages that add no value and parameter variants do not belong there. lastmod should change only when the content meaningfully changes, because a sitemap where every URL claims today's date trains crawlers to ignore the field. On WordPress core I use wp-sitemap.xml and adjust it with wp_sitemaps_posts_query_args or wp_sitemaps_taxonomies_query_args; on custom builds I emit a sitemap index from PHP with stable absolute URLs.
- Split large sitemaps by post type and submit a sitemap index
- Exclude noindex, redirected and canonicalised-away URLs
- Use accurate lastmod values from the real content change date
- Submit in Search Console and watch the discovered-URL count
- Keep absolute URLs on the public domain, never staging hosts
Internal linking depth and the paths crawlers follow
Crawlers discover most URLs by following links, so a page buried behind five clicks may simply never get fetched. Click depth is the distance from the home page, and it is one of the few crawl levers entirely under your control. I keep money pages, new articles and key product categories within three clicks of the home page, using a shallow hub structure rather than a long chronological archive. Breadcrumbs with BreadcrumbList JSON-LD give both a visible path and a machine-readable one; an HTML sitemap gives a second route to older content. The same applies to pruning: if a tag archive has ten posts and no internal links, it is cheap to let it fall out of the index.
- Aim for three clicks or fewer from the home page for priority URLs
- Link from hubs and breadcrumbs, not only from the latest-posts widget
- Publish an HTML sitemap alongside the XML one
- Prune thin archives that consume requests without earning clicks
- Check for orphan pages that no internal link reaches
How I implement this in WordPress and PHP
On WordPress I keep the controls in code rather than scattered across plugin screens. A small mu-plugin emits the canonical and meta robots tag from the same post object that renders the content, so a filtered view and its canonical cannot drift apart. register_post_type with rewrite and query_var settings controls which archive routes exist at all, which is cheaper than blocking them later. For custom PHP applications I put parameter normalisation in the routing layer: strip tracking keys, redirect the clean form with a 301, and never generate two versions of one page. On webdev-saif.com I also cache log summaries with transients so a daily crawl report does not hammer the database.
- mu-plugin for canonical and robots output, sourced from the content model
- register_post_type rewrite and query_var to avoid unwanted archive routes
- 301 from tracking-parameter URLs to the clean canonical form
- wp_sitemaps_* filters to exclude pages and taxonomies cleanly
- Transients or object cache for repeated log-parsing jobs
Trade-offs, measurement and a cadence that holds
Two mistakes undo most crawl work. The first is using robots.txt to hide thin pages that are already indexed; robots.txt stops crawling, not indexing, so the URLs stay in the results with stale snippets. The second is throttling crawlers to protect a slow server when the real fix is caching, a faster database query or a CDN. I measure the outcome with Crawl Stats request counts, the submitted-versus-indexed ratio in Search Console, and the share of log requests that hit canonical 200 URLs. A practical target is steady or falling request volume with a rising share of useful URLs. I am Saif Al Jahan, a WordPress and PHP developer in Mymensingh, Bangladesh, and I review logs monthly on catalogue builds and quarterly on smaller sites.
Frequently asked questions
What is crawl budget optimization in simple terms?
It is the practice of removing wasted crawler requests so the pages you care about get fetched and indexed sooner. In practice that means reading server logs to see what bots actually request, consolidating parameter-driven duplicates with canonicals, keeping the XML sitemap to clean indexable URLs, and linking priority pages within a few clicks of the home page.
Does crawl budget matter for a small WordPress site?
Usually not much. A site with a few dozen pages and stable content is rarely limited by request volume; clearer titles, internal links and faster responses will move the needle more. Crawl budget becomes relevant when you have thousands of URLs, frequent publishing, faceted WooCommerce filters, or a server that responds slowly enough that crawlers reduce their request rate.
How can I see what Googlebot actually crawls on my site?
Open your server's access log and filter by the Googlebot user agent, then group requests by status code and URL path. Search Console's Crawl Stats report gives useful aggregates, but logs show the exact query strings and templates being fetched. Because user agents can be spoofed, verify the IP through reverse DNS before drawing conclusions. Tools like GoAccess help; a short awk or PHP parser gives finer control.
Should I block URL parameters in robots.txt?
Only when you have identified the exact pattern and confirmed it serves no crawlable value. A narrow Disallow rule for a tracking or session parameter is fine, but robots.txt does not remove a URL that is already indexed. For removal, use a noindex meta tag on the rendered page. Keep pagination and legitimate filter states crawlable, and point filtered views at a clean canonical.
How deep should internal links go?
I aim for three clicks or fewer from the home page to any page that matters commercially or editorially. Deeper pages still get discovered through sitemaps and older links, but they receive fewer routine crawls. Breadcrumbs, hub pages and an HTML sitemap shorten paths and give crawlers a second route to content that would otherwise sit at the edge of the archive.
How often should I clean up my XML sitemap?
Generate it automatically from the published, indexable URL set so it is correct on every request, then review it quarterly. Check that submitted URLs are canonical and return HTTP 200, that lastmod reflects real content changes, and that no staging or parameter URLs slipped in. Watch the submitted-versus-indexed count in Search Console as the practical signal.