Sometimes also /#!
I search console most of these urls, which is a lot, end up ind “Excluded by tag noindex” instead of “Alternate page with correct canonical tag”.
SOME of them gets into “correct canonical tag” but not nearly as many as in the “noindex” group.
Pagination canonical works fine.
They are not indexed by Google, but I don’t like that they are not registered correctly and Google does lot view the urls as they really are.
Is it some setting I have overlooked?
]]>Problem:
For example, if this page example.com/page/ has a Visual Portfolio instance with any pagination or filter, search engine crawlers will see these additional pages (they will vary based on your gallery/feed configuration):
example.com/page/?vp_page=2
example.com/page/?vp_page=3
example.com/page/?vp_page=4
example.com/page/?vp_filter=category:uncategorized
The problem is that each is considered an individual (separate) page with the same page content (the Visual Portfolio gallery content is the exception). Rank Math, by default, is unable to distinguish these pages and sets each one with its unique canonical URL corresponding to the URL parameters, as represented above.
(For example, example.com/page/?vp_filter=category:uncategorized would be assigned a canonical URL of example.com/page/?vp_filter=category:uncategorized even though it should be assigned example.com/page/ since it is ultimately the same page and the only one we want search engines to crawl and display in search results).
When it comes to SEO, duplicate content is a huge no-no because it essentially means each of these pages is competing with the other ones. Search engines like Google will get confused when deciding which to show in search results, making ranking incredibly difficult. So, to fix this issue, I wanted to share my solution in the event that it might help someone else using Rank Math and Visual Portfolio who is unable to fix their duplicate content issue.
Solution:
All you need to do is either add the following code to your theme’s functions.php file OR use a code editor plugin like Advanced Scripts, making sure it runs no later than the plugins_loaded hook:
/**
* Modify the canonical URL to exclude Visual Portfolio filtering parameters.
*
* This function hooks into Rank Math's canonical URL filter to check for and
* remove specific query parameters (those starting with 'vp_') from the canonical URL.
* This approach aims to prevent potential duplicate content issues by ensuring that
* search engines see a single, authoritative version of each page, even when
* Visual Portfolio's deep linking feature is used to create unique URLs for filtered gallery views.
*
* @param string $canonical The original canonical URL.
* @return string The modified canonical URL, with 'vp_' parameters removed.
*/
add_filter( 'rank_math/frontend/canonical', function( $canonical ) {
// Parse the current canonical URL to break it down into components.
$url_parts = wp_parse_url($canonical);
// Check if there are any query args to work with.
if (!empty($url_parts['query'])) {
// Convert the query parameters into an associative array.
parse_str($url_parts['query'], $query_args);
// Iterate through the query parameters and remove those starting with 'vp_'.
foreach ($query_args as $key => $value) {
if (strpos($key, 'vp_') === 0) {
unset($query_args[$key]);
}
}
// Reassemble the URL without the 'vp_' parameters.
$canonical = $url_parts['scheme'] . '://' . $url_parts['host'];
// Include the port number in the URL if it's present.
if (!empty($url_parts['port'])) {
$canonical .= ':' . $url_parts['port'];
}
$canonical .= $url_parts['path'];
// Only append the modified query if it's not empty.
if (!empty($query_args)) {
$canonical .= '?' . http_build_query($query_args);
}
}
return $canonical;
});
You will note that the script essentially looks for the existence of URL parameters prefixed with vp_ and removes them from the canonical URL, resulting in a much cleaner and industry-preferred method of setting canonical URLs. This will prevent duplicate content/meta tag errors and make your website crawl and interpret easier.
Hope this helps!
]]>so my question is basically could they hurt you google rankings badly ?
or google is smart about them nowadays , so if use badly – it dont helps you but dont hurt you much either
possible issues
I’m having an issue indexing a page with the Helpie FAQ app installed on it. The landing page is being flagged as having a ‘duplicate field FAQPage’ however, I can’t seem to find where the FAQ is duplicated on the backend of the website?
Beyond satisfied with this plugin…
]]>I hope you’re all doing well. I am facing an issue with my SEO plugin regarding Canonical URLs on my e-commerce website. I am using the “Yoast SEO” plugin for managing my website’s SEO, and I have product variations for some of my products, which are causing duplicate content concerns.
Problem: The product variations on my website have separate URLs, but their content is quite similar. This has resulted in search engines flagging it as duplicate content, and it might be affecting my website’s SEO rankings.
Example: Let’s take one of my products, “Moroccan leather sandals,” which comes in different colors and sizes. The main product page URL is: https://madeinatlas.com/moroccan-leather-sandals-boho-wedding-sandals/?attribute_pa_design=design-a&attribute_pa_color=black&attribute_pa_size=5-us
However, the product variations have their URLs:
As you can see, the product variation page URL contains query parameters for design, color, and size, but the Canonical URL should point to the main product page without these attributes.
Solution Needed: I believe implementing the correct Canonical URL for product variation pages will resolve this issue. By correctly specifying the Canonical URL for the product variation, search engines can understand that the main product page is the preferred version and avoid duplicate content penalties.
Questions:
Additional Information: