Dynamic URLs Optimisation

D

Defining Dynamic URLs

A URL is the address of a page on a website. URLs come in two kinds:

  • A static URL is a plain address with nothing added to it, such as: https://wordprexeo.com/technical-seo/url-optimisation/dynamic-urls/.
  • A dynamic URL is an address with extra details added after a question mark. These details tell the website what to show. For example, https://wordprexeo.com/?s=dynamic+urls shows the results of a search for “dynamic urls” on WordPrexeo.

The extra details after the question mark are called URL parameters, also known as query parameters or URL variables. Together they make up the URL’s query string. Parameters follow the same pattern in every URL:

  • The question mark (?) marks where the parameters begin. Everything before it is the static part of the URL.
  • s=dynamic+urls is one parameter, made up of:
    • a key (s, short for search),
    • an equals sign, and
    • a value (dynamic+urls): the term typed into the website’s search box, where + stands for the space between the two words.
  • The ampersand (&) separates one parameter from the next, in URLs that have more than one. ?s=dynamic+urls&orderby=title, for example, lists the same results as ?s=dynamic+urls, sorted by title.
  • The hash sign (#) starts a fragment, which is a pointer to one place within the page. It appears only in URLs that point to such a place. For example, https://wordprexeo.com/technical-seo/url-optimisation/dynamic-urls/#url-parameter-types opens this page at the Types of URL Parameters section. A fragment is not a parameter. Only the browser uses it, and the website never receives it. Search engines ignore it too, so they treat a URL with a fragment as the same page as the URL without it.

Dynamic URLs are not themselves a problem. Search engines handle a dynamic URL exactly as they handle a static one. They crawl it, meaning they request the page from the website. They index it, meaning they store the page so that it can appear in search results.

The issues come from volume. Search engines treat every distinct URL as a separate page. Every new parameter, value or combination creates another URL, so a handful of parameters can turn one page into thousands of addresses. Dynamic URL Optimisation is the practice of controlling which of those addresses search engines spend time on and show in search results.

Dynamic URL Optimisation is part of the larger subject of URL Optimisation, and it follows URL Taxonomy. URL Taxonomy settles the static part of a website’s URLs: the folders and page names that you choose. This page covers the part that the website adds on its own. Every WordPress website produces some dynamic URLs. How much work they need depends on the size of the website. A knowledgebase the size of WordPrexeo needs a few settings checked. An online shop with product filters needs a deliberate plan.

Types of URL Parameters

Every URL parameter belongs to one of three groups, depending on what it does to the page it is added to:

  • Passive parameters leave the page unchanged. They only record information about the visit.
  • Active parameters change what the page shows.
  • Action parameters make the website perform a task, such as sharing a page on LinkedIn.
GroupPurposeWhat it doesExample
PassiveTrackingRecords where a visitor came from, such as a link to this page shared on LinkedIn?utm_source=linkedin
PassiveSession identificationIdentifies one visitor’s browsing session?sessionid=8f2a91
ActiveIdentifyingSelects which page to show, using the ID number that WordPress gives each page (this page’s is 5210)?page_id=5210
ActiveSortingShows the same items in a different order, such as search results sorted by title?orderby=title
ActiveFilteringNarrows a list down to the items that match a criterion, such as search results from WordPrexeo’s Technical SEO section only?section=technical-seo
ActivePaginationShows one part of a list that is split across several pages, such as the second page of search results?paged=2
ActiveSearchingShows results for a query typed into the website’s search box?s=dynamic+urls
ActiveTranslatingShows the page in another language, such as a German version of this page?lang=de
ActionPerforming an actionTriggers a task on the website rather than showing content, such as sharing this page on LinkedIn?share=linkedin

Common Issues Caused by Dynamic URLs

When parameters multiply a website’s URLs, they cause three issues for search engines and one for users.

Duplicate Content

Duplicate content occurs when several URLs show the same content, or nearly the same. Dynamic URLs create it in three ways:

  • Passive parameters always create it, because they leave the page unchanged. For example, this page’s address and the same address followed by ?utm_source=linkedin are two URLs for one page.
  • Sorting creates it by showing the same items in a different order. For example, ?s=dynamic+urls&orderby=title shows the same results as ?s=dynamic+urls, only sorted by title.
  • Writing the same parameters in a different order or case creates it too. ?s=dynamic+urls&orderby=title, ?orderby=title&s=dynamic+urls and ?s=Dynamic+URLs&orderby=title are three URLs for one set of results.

When a search engine finds duplicates, it chooses one version to show in search results and treats the rest as copies. If you leave the choice to the search engine alone, it may pick a version you would not, such as this page with ?utm_source=linkedin attached. That matters because links from other pages are one of the signals that help a page rank. Links pointing at the copies may not count towards the version you want to rank.

Thin Content

Thin content is the name for URLs that hold little or nothing of value. Filtering and searching produce it whenever a combination matches nothing. For example, ?s=dynamic+urls&section=offpage asks for results about dynamic URLs from WordPrexeo’s Offpage section, which has none. The page shows only a “no results” message, yet it has a URL of its own. Search engines will find that URL if anything links to it.

Every page a website sends comes with a status code, which is a three-digit signal to browsers and search engines. A 200 status code means the page loaded successfully. A 404 status code means the page does not exist. An empty results page usually returns 200 anyway. Search engines then do one of two things. They index the page, which adds a low-value page to the website’s presence in search. Or they classify it as a soft 404: a page that looks like an error to visitors but reports success to search engines.

Crawl Waste

Crawl waste is the name for search engine requests spent on URLs that do not deserve them. Parameters multiply URLs quickly. A single search on WordPrexeo, sorted three ways and split across three pages, already makes 9 URLs. Narrowing the results to each of WordPrexeo’s sections multiplies that number again, and every new search term starts the count over. A search box accepts any term, so the number of possible search URLs has no end. Search engines call this an infinite space.

Search engines request only so many URLs from each website. Google calls this capacity the crawl budget. In 2025, Google’s crawling team reviewed the problems it had met. Half of them came from filter menus, known as faceted navigation. A quarter came from action parameters, and a further 10% from passive parameters, which Google calls irrelevant parameters.

Crawl budget rarely limits a small website. Google’s crawl budget guidance is written for three kinds of website:

  • websites with over 1 million pages that change weekly;
  • websites with over 10,000 pages that change daily;
  • websites with a large share of URLs that Google Search Console, Google’s free tool for website owners, lists as Discovered – currently not indexed, meaning found but not yet crawled.

A website of any size can fall into the third group if its parameters generate enough URLs. Websites outside these groups rarely suffer harm from crawl waste, while duplicate and thin content still harm them.

Poor Readability

For users, parameters make URLs long and hard to read. A URL is often the first thing people see when a link is shared in an email or a message. https://wordprexeo.com/technical-seo/url-optimisation/dynamic-urls/ tells them what the page covers, while https://wordprexeo.com/?s=dynamic+urls&orderby=title&paged=2 leaves them to work it out. In search results the effect is smaller, because Google shows only the website’s domain on mobile, and adds a breadcrumb trail on desktop. A breadcrumb trail lists the sections that lead to the page.

How to Control Dynamic URLs

A search engine deals with every URL at four points:

  1. It discovers the URL, usually through a link.
  2. It crawls the URL.
  3. It indexes the page.
  4. Where several URLs show the same content, it consolidates them, choosing the one version that represents the content in search results.

Each control acts at one of these points. The earlier the point, the more efficient the control, because a URL that is never created costs nothing to manage.

AI assistants, such as ChatGPT, and AI answers in search results, such as Google’s AI Overviews, gather pages in two ways: through crawlers of their own, or through search engines’ indexes. The same controls therefore shape what they fetch and which version of a URL they cite.

At Discovery: Prevent Unnecessary URLs

The most efficient controls stop unnecessary parameter URLs from being created in the first place, or from being linked to:

  • Remove parameters that serve no purpose. Session IDs are the usual example. A session ID tells the website which visitor is which as they move from page to page. Cookies, small files that the browser keeps for the website, have done that job for many years without touching the URL. Some older systems still add session IDs to URLs anyway.
  • Keep tracking parameters off your own links. ?utm_source=linkedin belongs on the link to this page that is shared on LinkedIn. Links to this page from other WordPrexeo pages carry no parameters at all.
  • Keep browser-only filters in a fragment. Filters that narrow a list without reloading the page can record the chosen filter after a hash sign, as in #section=technical-seo. Google’s faceted navigation guidance specifies that these filtered views never become separate URLs.
  • Keep parameter URLs consistent, so that the same selection always produces the same URL:
    • parameters in one fixed order, whichever order the visitor selects them in;
    • keys and values in lowercase, since search engines treat ?section=Technical-SEO and ?section=technical-seo as two different URLs;
    • no empty values, so that ?s=dynamic+urls&section= becomes ?s=dynamic+urls;
    • several values under one key, as in ?section=onpage,technical-seo, rather than a repeated key, as in ?section=onpage&section=technical-seo;
    • the standard separators, = between a key and its value and & between parameters, as set out in Google’s URL structure guidance. Crawlers struggle to recognise colons, semicolons and brackets as separators.
  • Give anything worth ranking a static URL. A topic people search for deserves a page of its own, not a search or filter URL. For example, a search for “dynamic urls” on WordPrexeo leads to ?s=dynamic+urls. The topic itself has this page, which has a static URL, its own Page Title and content written for that search. The same principle gives each language version a subdirectory, which is a folder in the URL such as /de/, in place of ?lang=de. It gives each WordPress page a static URL in place of ?page_id=5210.

At Crawling: Block Requests with Robots.txt

A robots.txt file is a plain-text file at the root of a website [https://wordprexeo.com/robots.txt]. It tells crawlers which URLs not to request. In the example below:

  • User-agent: * addresses every crawler that has no rules of its own, including the crawlers that collect content for AI assistants;
  • Disallow: /*?*orderby= blocks every URL with orderby= after its question mark, with the asterisk (*) standing for any characters.
User-agent: *
Disallow: /*?*orderby=

Robots.txt is the only control that stops crawling outright. That makes it the right tool in two cases: for action parameters on any website, and for sorting and filtering parameters on websites that generate many such URLs, such as online shops. Its limit follows from how it works. A blocked URL is never crawled, so search engines never see the instructions in its code. One such instruction is a noindex tag, which asks search engines to keep the page out of search results. Two consequences follow:

  • If other pages link to a blocked URL, it can still appear in search results, without its content, as Google’s robots.txt introduction suggests.
  • Blocking does not remove URLs that are already indexed. Clear them out first, with a noindex tag or with a canonical tag that points to the preferred version. Add the robots.txt rule once Search Console shows them as excluded. Where speed matters, use the Removals tool in Search Console. It hides every URL that starts with a given prefix, such as https://wordprexeo.com/?s=, from Google’s results for about six months, which gives the noindex or canonical tag time to take effect.

At Indexing: Keep Pages out of Search Results

Two controls keep a crawlable URL out of search results:

  • A noindex tag, <meta name="robots" content="noindex"> in the page’s code, tells search engines not to show the page in search results, as Google’s noindex guidance explains. It suits pages that visitors need but searchers do not, such as WordPrexeo’s search results. It does not suit duplicates, because links pointing at a noindexed page do nothing for the version you want to rank. It also saves no crawl budget, because search engines still have to request the page to read the tag.
  • A 404 status code tells search engines that the page does not exist. They drop the page from the index and crawl it less often. A 404 is the right answer for a filter or search combination that matches nothing. Google’s faceted navigation guidance asks for the 404 to be returned at that URL itself, not through a redirect to a general error page. WordPress and WooCommerce answer an empty search or filter with a 200 status code and a “nothing found” message, so returning a 404 needs custom code. For most websites, blocking those URLs from crawling is the practical route.

At Consolidation: Point Duplicates to One Version

Three signals tell search engines which version of a duplicate to show. The first two also pass the value of links that point at the copies on to that version:

  • A canonical tag names the preferred URL, usually the page’s clean URL: its address without parameters. This page, for example, carries <link rel="canonical" href="https://wordprexeo.com/technical-seo/url-optimisation/dynamic-urls/"> in its code. Its version with ?utm_source=linkedin attached carries the same tag, so it also points search engines back to the clean URL. Visitors can still use every version, so the canonical tag is the standard fix for tracking parameters and other duplicates that must keep working. Search engines treat it as a strong signal rather than a rule.
  • A 301 redirect sends visitors and search engines from one URL to another, permanently. It is a stronger signal than the canonical tag. It suits parameter URLs that should never be visited at all. WordPress uses it by default for every page: the address built from a page’s ID number, such as ?page_id=5210 for this page, redirects to the page’s static URL.
  • An XML sitemap is a file that lists a website’s pages for search engines. Listing each page only at its clean URL tells search engines which version to prefer. It is the weakest of the three signals.

These are the same three signals that set a website’s Canonical Domain: the version of its address that search engines should show, such as https://wordprexeo.com/ rather than http://www.wordprexeo.com/. For the Canonical Domain, the signals choose between versions of the whole website. For dynamic URLs, they choose between versions of a single page.

Choosing the Right Control for Each Parameter

The right control follows from what the parameter does:

PurposeRecommended handling
TrackingCanonical tag pointing to the clean URL
Session identificationReplace with cookies; until then, canonical tag pointing to the clean URL
IdentifyingStatic URLs, with 301 redirects from the parameter versions
SortingCanonical tag pointing to the default order; on websites with many sorting options, block crawling in robots.txt
FilteringStatic pages for the combinations people search for; block crawling of the rest in robots.txt. Where filter URLs stay crawlable, return a 404 for combinations with no items
PaginationKeep every page indexable, with a self-referencing canonical tag
SearchingNoindex; where search pages are crawled heavily, block crawling in robots.txt once they have left the index
TranslatingSubdirectories, such as https://wordprexeo.com/de/, in place of parameters
Performing an actionBlock crawling in robots.txt

Pagination is the one exception to the rules for duplicates. Each page of a list shows different items, so page 2 is not a copy of page 1. Pointing its canonical tag at page 1, or adding noindex, would hide every item listed beyond the first page from search engines.

Search engines reach later pages by following ordinary links. They do not click buttons. “Load more” buttons and infinite scroll, which loads more items as the visitor scrolls down, therefore need a real link to each page behind them.

Google’s pagination guidance suggests that the rel="next" and rel="prev" tags, which once connected paginated pages to one another, are no longer used by Google. Other search engines may still use them, so they can stay where they already exist.

For translating, Google does not recommend parameters as a way of separating language versions. Subdirectories give each language its own set of static URLs. Hreflang annotations connect those versions to one another. These are tags that tell search engines which language each version is written in.

Optimising Dynamic URLs in WordPress

WordPress, and Rank Math, the SEO plugin that these steps use, handle much of the above by default. The steps below confirm that the defaults are in place and cover the cases that need attention. Steps 6 to 8 apply only to the websites that each of them names.

1. Find the Website Parameters

Dynamic URLs on a WordPress website come from three sources: WordPress itself; its plugins, such as the WooCommerce shop plugin; and the platforms that add parameters to links pointing at your pages.

SourceParametersPurposeDefault handling
WordPress?p=, ?page_id=, ?cat=, ?author=IdentifyingRedirected to the static URL, unless permalinks are set to Plain (Step 2)
WordPress?s=SearchingNoindex, set in Rank Math (Step 4)
WordPress?paged=PaginationShown as /page/2/ once permalinks are static (Step 2); kept indexable (Step 4)
WordPress?replytocom=Identifying the comment being replied toCanonical tag points to the post
WooCommerce?orderby=, ?min_price=, and ?filter_ followed by a product attributeSorting and filteringCanonical tag points to the unfiltered page (Rank Math)
WooCommerce?add-to-cart=Performing an actionNeeds blocking in robots.txt (Step 8)
Multilingual plugins?lang=TranslatingNeeds a settings change (Step 7)
Email, advertising and social platforms?utm_source=, ?gclid=, ?fbclid=TrackingCanonical tag points to the clean URL (Rank Math)

WordPress also lists a short alternative address, called a shortlink, for every post and page in its code. The shortlink is built from the page’s ID number and redirects to the static URL, so it needs no action.

To see which parameter URLs Google has found, open Google Search Console and go to Indexing → Pages. Parameter URLs appear among the examples listed under these four statuses:

  • Alternate page with proper canonical tag
  • Duplicate without user-selected canonical
  • Duplicate, Google chose different canonical than user
  • Crawled – currently not indexed

Ahrefs’ Site Audit also lists parameter URLs. Site Audit is a tool that checks a website for SEO issues, and it is free for websites whose ownership you have verified in Ahrefs Webmaster Tools.

WordPress calls the permanent URL of each post and page its permalink. The Plain permalink setting builds every permalink from parameters, such as ?page_id=5210.

  1. Go to Settings → Permalinks.
  2. Under Permalink structure, select any option other than Plain, such as Post name.
  3. Click Save Changes.

Switching from Plain needs no redirects of your own, because WordPress redirects the old parameter URLs to the new static ones itself. Switching from one static structure to another is different, because it changes the URL of every post. In that case, add 301 redirects from the old URLs in Rank Math SEO → Redirections.

3. Check Canonical Tags

Rank Math automatically adds a canonical tag to every page, which points to the page’s clean URL. That consolidates tracking, sorting and filtering duplicates with no further work. Rank Math’s XML sitemap supports the same choice by listing only clean URLs. To confirm the canonical tag on your website:

  1. Open any page with ?utm_source=test added to its address. For this page, that is https://wordprexeo.com/technical-seo/url-optimisation/dynamic-urls/?utm_source=test.
  2. Right-click the page, choose View Page Source and search for rel="canonical".
  3. Check that the canonical URL is the page’s clean URL, without the parameter.

To set a different canonical URL for a single page, open the page in the editor, click the Rank Math icon in the top bar, open the Advanced tab and fill in Canonical URL. Leave paginated pages with their default, self-referencing canonical tag.

4. Check Indexing Settings

  1. Go to Rank Math SEO → Titles & Meta → Miscellaneous Pages.
  2. Enable Noindex Search Results, which keeps internal search results out of search engines.
  3. Disable Noindex Subpages, which would otherwise noindex page 2 onwards of every archive.
  4. Click Save Changes.

Avoid linking to search result URLs from menus or content, so that search engines have no route to them.

Check menus, buttons and internal links within your content for tracking parameters, and remove any you find. Links without parameters confirm your choice of canonical to search engines. Tracking parameters on internal links do more than create duplicates. They distort Google Analytics, Google’s tool for measuring visits, because they can make it credit visits and conversions to the tagged campaign instead of their real source.

6. Use Dedicated Pages for Shop Filters

For WooCommerce shops, the filter combinations people search for deserve a page of their own:

  1. Confirm that people search for the combination, for example in Ahrefs’ Keywords Explorer.
  2. Go to Products → Categories and create a category for it, nested under its parent category.
  3. Assign the matching products to it and give it a description written for that search.

The combination now has a static URL, its own title and its own description, where the filtered version had none.

7. Use Subdirectories for Language Parameters

This step applies to multilingual websites whose plugin shows languages as a parameter, such as ?lang=de.

  1. Open the language URL settings: in WPML, go to WPML → Languages → Language URL format; in Polylang, go to Languages → Settings → URL modifications.
  2. Select the directory option: Different languages in directories in WPML, or The language is set from the directory name in pretty permalinks in Polylang, and save.
  3. Check that the old parameter URLs now redirect to the new ones, and add 301 redirects in Rank Math SEO → Redirections wherever they do not.

8. Prevent Crawl Waste with robots.txt

This step applies to online shops, and to websites whose filters, sorting or search generate a large number of URLs. First, remove any parameter URLs that are already indexed from the index, as explained under At Crawling.

  1. Go to Rank Math SEO → General Settings → Edit robots.txt. If the option is missing, switch Rank Math from Easy Mode to Advanced Mode on its dashboard first.
  2. Add the rules you need from the example below inside the existing User-agent: * group, beneath its Disallow and Allow lines and above the Sitemap line.
  3. Test the rules before saving, because a mistyped rule can block pages you want in search. Rank Math PRO has a Validate Code button under the editor. With the free version, use Rank Math’s free robots.txt tester.
  4. Click Save Changes.
# Every WooCommerce shop: action parameters
Disallow: /*?*add-to-cart=
# Large catalogues: sorting and filters
Disallow: /*?*orderby=
Disallow: /*?*filter_
Disallow: /*?*min_price=
Disallow: /*?*max_price=
# Heavily crawled internal search
Disallow: /*?s=
Disallow: /*&s=
Disallow: /search/

If the robots.txt field in Rank Math is locked, a robots.txt file already exists on the server. Edit that file through your hosting provider’s file manager instead. On Hostinger, the file sits in the public_html folder of File Manager.

9. Verify the Results in Google Search Console

  1. Copy a parameter URL from the Pages report (Step 1) and paste it into the URL Inspection bar at the top of Google Search Console.
  2. Under Page indexing, compare the User-declared canonical with the Google-selected canonical. When both show the clean URL, consolidation is working.
  3. A few weeks after making changes, recheck Indexing → Pages. Parameter URLs should now appear under Alternate page with proper canonical tag, Excluded by ‘noindex’ tag or Blocked by robots.txt, according to the control applied.

On websites with more than about a thousand pages, Settings → Crawl stats in Search Console shows examples of the URLs that Google’s crawler has requested. Parameter URLs still listed there are crawl waste that the controls above have not yet stopped. Search Console has no setting for parameters themselves, because Google retired its URL Parameters tool in 2022. The controls on the website itself are therefore the only way to influence how Google treats parameter URLs.