News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

URL with fake category between categories redirects to product

Started by alxgan, May 13, 2024, 09:50:08 AM

Previous topic - Next topic

alxgan

In VirtueMart 4.2.10 11010 if you enter in URL any string as "category" between categories, it will still route to display the product (which is bad SEO).
For example:
 www.example.com/category/sub-category/product.html
can be also displayed with
 www.example.com/category/fake_category/sub-category/other_fake_category/product.html

The links inside the product page and breadcrumbs don't have the "fake" sub-categories but Google sees them as duplicated content as I can create as much as links I can.

Can someone please test it and confirm if is a bug or a feature? :)

cdbaron88

In previous versions, the same issue also occurs.
However, <link href="https://www.example.com/category/sub-category/product.html" rel="canonical" /> is added, so I don't think it's a problem for SEO.

What do you think?

Milbo

There are some topics about that already, maybe I should write a FAQ, there are "endless" valid urls for a canonical url.
If you use a product suffix at the end, you can enter waht you want between.

If you enter it correct, a product in different categories will show always the correct canonical, and then the url for the product in the NOT canonical URL.
So if the categories are fantasy, the last function does not work correct, we can just ignore that, because we are anyway in the "error happened area".
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

alxgan

Thank you for the info guys.
In my case, for a 200 links site, I have more de 4500 links in google console. Some of them are served better in search than the correct canonical version.
Maybe it's just me but if there is a fantasy/fake/old url maybe a redirect to the canonical link would be more appropriate. For example if there is a best_category with best_product with link "best_category/best_product.html" then any url www.domain.com/fake_category/best_product.html should redirect to the canonical link www.domain.com/best_category/best_product.html.

hazael

In your template, for your product URL, instead of using category_id by default, choose
product_canon_category_id. This prevents your server from generating an excessive amount of unnecessary data and saves RAM

Quotevirtuemart_category_id='.$product->category_id
change to:
Quotevirtuemart_category_id='.$product->product_canon_category_id

Multiplying an excessive number of duplicate links is not beneficial for SEO and website performance. Even though a canonical URL helps Google identify the preferred version of a page, search engine bots can still crawl and index duplicates, which can lead to issues.

Here are some reasons why you should limit generating excessive duplicates:

Disk space savings: Storing multiple copies of the same page takes up more server space.

RAM savings: Indexing and processing duplicates consumes more RAM, which can slow down the server.

Processor power savings: Processing duplicates requires more CPU power, which can lead to server overload.

Longer indexing time: An excess of duplicates can increase the time it takes for Google to find and index the correct version of the page.

Ranking issues: Google may penalize pages with an excessive number of duplicates, which can lower their search engine ranking.

Instead of multiplying duplicates, focus on creating high-quality content and building valuable links to the preferred version of the page. Only use a canonical URL when you have multiple versions of the same page, such as with different URL parameters or language versions.

In addition, you can implement strategies that limit duplicate creation, such as:

Using structured data: Adding structured data to pages helps Google better understand their content and context, which can reduce the risk of indexing duplicates.

Blocking duplicates in robots.txt: You can configure the robots.txt file to prevent search engine bots from indexing specific folders or files that contain duplicates.

Using the canonical meta tag: The canonical meta tag can be added to the HTML code of pages to point Google to the preferred version of the page.

Remember, SEO is an ongoing process, and regular monitoring and updating your linking strategy is crucial for ensuring optimal page performance.

Milbo

Hazel we send always the canonical url and if the current url is differnt but valid, we add the other url.
But any url added in the header should not reflect the fantasy categories.

mysite.com/canonCat/myproduct-detail =>

<link href="http://mysite.com/canonCat/myproduct-detail" rel="canonical">

if you used mysite.com/validCat/myproduct-detail or if the product is available in other languages, you get an extra line in the header like

<link href="/validCat/myproduct-detail" rel="alternate" hreflang="de-DE">

So your whole text does not fit here, because your almost last sentence says it

QuoteUsing the canonical meta tag: The canonical meta tag can be added to the HTML code of pages to point Google to the preferred version of the page.

So if you enter mysite.com/fantasyCat/myproduct-detail

your header will show <link href="http://mysite.com/canonCat/myproduct-detail" rel="canonical">
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/