The pages of my Angular site have been deindexed from Google, and i don't understand the cause

Discussão em 'Angular' iniciado por LG.Poirot, Janeiro 3, 2025.

  1. LG.Poirot

    LG.Poirot Guest

    I have an issue with the indexing of my website's pages on Google Search. For several months, more and more of my pages have been de-indexed from Google with the reason "Page with redirect."

    Moreover, the indicated canonical URL is always the same incorrect URL, even though I am passing a different one.

    However, my pages and their canonicals are always valid when I test them using the "live test" tool in Google Search Console, tools like "Screaming Frog SEO," or by making CURL requests on my pages simulating the Google bot with the following command:

    curl -A "Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5X Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.6778.139 Mobile Safari/537.36 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)" https://www.monsite.com/mapage > local.html


    The site is developed in Angular 18 and uses Angular's native SSR (not prerender). My canonicals are dynamically generated with the following method:

    public updateCanonical(): void {
    const url = this.router.url; (this.router refers to Router from @angular/router)
    const canonicalUrl = `${environment.frontUrl}${url}`;
    const head = this.document.getElementsByTagName('head')[0]; (this.document refers to @Inject(DOCUMENT) from @angular/common)
    let element: HTMLLinkElement = this.document.querySelector('link[rel='canonical']') || null;
    if (element == null) {
    element = this.document.createElement('link');
    head.appendChild(element);
    }
    element.setAttribute('rel', 'canonical');
    element.setAttribute('href', canonicalUrl);
    }


    Has anyone ever experienced a similar issue or have any ideas for a solution or lead to resolve this problem?

    Thank you in advance

    Continue reading...

Compartilhe esta Página