What is a URL Parameter?
A URL parameter is a method for passing data to web applications by placing variables in the URL. These parameters begin after the "?" character of some URLs, and contains the name of the parameter followed by the equals sign and its value. Each parameter is separated using the "&" character.
In the URL "http://www.example.com/view-product.php?productid=34284&sort=asc&page=2", we can see three different URL parameters:
Parameter Name: productid
Parameter Name: sort
Parameter Name: page
URL parameters can serve many purposes, but generally speaking they are often used to pass data to the web application to be used to render the page. In our example above, the "view-product.php" page most likely is a template page that can dynamically display different products' details.
By passing the product ID as a URL parameter, the web application knows to retrieve this product's information from the database on display it on the page. It also knows to sort the other products on the page ascending (using the parameter "sort=asc"), and to start on page 2 ("page=2").
What Does "Too Many URL Parameters" Mean?
In general, it's usually a good idea to avoid using URL parameters unless necessary. However, if there is a good reason for using them, try to use as few as is necessary. Pages with 4 or more URL parameters will be listed as having too many.
Why It's Important
One of the main advantages of using URL parameters over other methods of passing data to web applications is that since all the data is saved in the URL, it's easy to bookmark or send a link to a page that was generated dynamically from the URL parameters. By using URL parameters you can easily send a link or a bookmark a specific product page, directions to a business on a mapping service, or saved search. This is not as easily done with other methods.
However, there are several drawbacks to using URL parameters as well:
- Multiple URL parameters often can create many duplicate or near-duplicate pages. Consider www.example.com/blue-widgets?sort=asc and www.example.com/blue-widgets?sort=desc – these two pages most likely have the exact same content, but arranged slightly differently on the page.
- Multiple URL parameters are not very friendly for humans to read, type, or remember. They're also prone to being overly long, which can be a usability issue.
- Often times, using URL parameters lends itself to not having keywords in the URL (Consider www.example.com/view-product.php?id=482794 vs. www.example.com/blue-widgets-chicago).
Of these three, duplicate content is the most severe issue we should worry about. If not handled properly, search engines could get confused while crawling your site, leading to lower indexation, indexation of the lesser-important pages while omitting more important ones, or lower ranking.
How To Fix
There are several things that you can do to avoid using too many URL parameters:
- Minimize the number of parameters by eliminating duplicate, unnecessary, or empty parameters from the URL.
- Use server-side URL rewrites to convert them into static, human-readable URLs (e.g. www.example.com/view-product.php?id=482794 --> www.example.com/blue-widgets-chicago).
- Instead of trying to remove or minimize the number of parameters in the URL, you could work to avoid duplicate content by using the rel="canonical" tag along with the robots.txt file to guide search engine crawlers away from the duplicate URLs and point towards the canonical ones.
A Word of Caution
When making changes to many URLs of existing pages on your site, it's important to remember that this process can be tricky and potentially risky if not done correctly. If the changes are not made correctly, it could result in the de-indexation or lower ranking of pages on your site. Therefore, the relatively small benefits that come from undertaking these changes may or may not be worth it for your site.
The process for fixing URLs on your site depends on multiple factors, and is too detailed to list here. Instead, remember a few important principles when updating many or all of the URLs on your site:
- Create an individual 301 redirect from the old URL to the new one for every page that is being updated
- Be sure to update all links on your site to point to the new URLs instead of the old ones.
- Test extensively before rolling out the change on your production server.
- Update and submit your XML sitemap.