[Skip to main content](https://developers.google.com/search/docs/crawling-indexing/javascript/fix-search-javascript#main-content)

[![Google Search Central](https://developers.google.com/static/search/images/google-search-central-logo.svg)](https://developers.google.com/search)

*   [Google Search Central](https://developers.google.com/search)
    

[Documentation](https://developers.google.com/search/docs)

*   SEO fundamentals
*   [Introduction](https://developers.google.com/search/docs)
    
*   [Search Essentials](https://developers.google.com/search/docs/essentials)
    
*   [SEO Starter Guide](https://developers.google.com/search/docs/fundamentals/seo-starter-guide)
    
*   [Optimizing for generative AI search](https://developers.google.com/search/docs/fundamentals/ai-optimization-guide)
    
*   [How Google Search Works](https://developers.google.com/search/docs/fundamentals/how-search-works)
    
*   [Do you need an SEO?](https://developers.google.com/search/docs/fundamentals/do-i-need-seo)
    

*   Crawling and indexing
*   [Sitemaps](https://developers.google.com/search/docs/crawling-indexing/sitemaps/overview)
    
*   [robots.txt](https://developers.google.com/search/docs/crawling-indexing/robots/intro)
    
*   [Meta tags](https://developers.google.com/search/docs/crawling-indexing/special-tags)
    
*   [Crawler management](https://developers.google.com/search/docs/crawling-indexing/ask-google-to-recrawl)
    
*   [Removals](https://developers.google.com/search/docs/crawling-indexing/control-what-you-share)
    
*   [Canonicalization](https://developers.google.com/search/docs/crawling-indexing/consolidate-duplicate-urls)
    
*   [Redirects](https://developers.google.com/search/docs/crawling-indexing/301-redirects)
    
*   [JavaScript SEO](https://developers.google.com/search/docs/crawling-indexing/javascript/javascript-seo-basics)
    

*   Ranking and search appearance
*   [Visual Elements gallery](https://developers.google.com/search/docs/appearance/visual-elements-gallery)
    
*   [Title links](https://developers.google.com/search/docs/appearance/title-link)
    
*   [Snippets](https://developers.google.com/search/docs/appearance/snippet)
    
*   [Images](https://developers.google.com/search/docs/appearance/google-images)
    
*   [Videos](https://developers.google.com/search/docs/appearance/video)
    
*   [Structured data](https://developers.google.com/search/docs/appearance/structured-data/search-gallery)
    
*   [Favicons](https://developers.google.com/search/docs/appearance/favicon-in-search)
    

*   Site-specific guides
*   [Ecommerce](https://developers.google.com/search/docs/specialty/ecommerce)
    
*   [International and multilingual sites](https://developers.google.com/search/docs/specialty/international)
    

*   Data analysis
*   [Get started with Search Console](https://developers.google.com/search/docs/monitor-debug/search-console-start)
    
*   [Debug traffic drops](https://developers.google.com/search/docs/monitor-debug/debugging-search-traffic-drops)
    
*   [Using Search Console and Google Analytics data for SEO](https://developers.google.com/search/docs/monitor-debug/google-analytics-search-console)
    
*   [Get started with Google Trends](https://developers.google.com/search/docs/monitor-debug/trends-start)
    

[Support](https://developers.google.com/search/help) [Blog](https://developers.google.com/search/blog) [What's new](https://developers.google.com/search/news)

*   [All updates](https://developers.google.com/search/news)
    
*   [Documentation updates](https://developers.google.com/search/updates)
    
*   [Ranking updates](https://status.search.google.com/products/rGHU1u87FJnkP6W2GwMi/history)
    
*   [New YouTube videos](https://www.youtube.com/channel/UCWf2ZlNsCGDS89VBF_awNvA)
    
*   [Recent podcast episodes](https://pod.link/1512522198)
    

[Events](https://developers.google.com/search/events) [Case studies](https://developers.google.com/search/case-studies)

/

*   English
*   Deutsch
*   Español
*   Español – América Latina
*   Français
*   Indonesia
*   Italiano
*   Polski
*   Português – Brasil
*   Tiếng Việt
*   Türkçe
*   Русский
*   العربيّة
*   हिंदी
*   ภาษาไทย
*   中文 – 简体
*   中文 – 繁體
*   日本語
*   한국어

Sign in

*   [Documentation](https://developers.google.com/search/docs)
    

[Search Console](https://goo.gle/searchconsole)

[![Google Search Central](https://developers.google.com/static/search/images/google-search-central-logo.svg)](https://developers.google.com/search)

*   [Google Search Central](https://developers.google.com/search)
    

*   [Documentation](https://developers.google.com/search/docs)
    *   More
*   [Support](https://developers.google.com/search/help)
    
*   [Blog](https://developers.google.com/search/blog)
    
*   [What's new](https://developers.google.com/search/news)
    *   More
*   [Events](https://developers.google.com/search/events)
    
*   [Case studies](https://developers.google.com/search/case-studies)
    

*   [Introduction](https://developers.google.com/search/docs)
    
*   Search Essentials
    
    *   [Overview](https://developers.google.com/search/docs/essentials)
        
    *   [Technical requirements](https://developers.google.com/search/docs/essentials/technical)
        
    *   [Spam policies](https://developers.google.com/search/docs/essentials/spam-policies)
        
    
*   SEO fundamentals
    
    *   [SEO Starter Guide](https://developers.google.com/search/docs/fundamentals/seo-starter-guide)
        
    *   [How Google Search works](https://developers.google.com/search/docs/fundamentals/how-search-works)
        
    *   [Creating helpful, reliable, people-first content](https://developers.google.com/search/docs/fundamentals/creating-helpful-content)
        
    *   Generative AI fundamentals
        
        *   [Optimizing for generative AI](https://developers.google.com/search/docs/fundamentals/ai-optimization-guide)
            
        *   [Guidance on using generative AI](https://developers.google.com/search/docs/fundamentals/using-gen-ai-content)
            
        
    *   [Maintaining your site's SEO](https://developers.google.com/search/docs/fundamentals/get-started)
        
    *   [Developer's guide to Search](https://developers.google.com/search/docs/fundamentals/get-started-developers)
        
    *   [Do you need an SEO?](https://developers.google.com/search/docs/fundamentals/do-i-need-seo)
        
    
*   Crawling and indexing
    
    *   [Overview](https://developers.google.com/search/docs/crawling-indexing)
        
    *   [File types Google can index](https://developers.google.com/search/docs/crawling-indexing/indexable-file-types)
        
    *   [URL structure](https://developers.google.com/search/docs/crawling-indexing/url-structure)
        
    *   [Links](https://developers.google.com/search/docs/crawling-indexing/links-crawlable)
        
    *   Sitemaps
        
        *   [Learn about sitemaps](https://developers.google.com/search/docs/crawling-indexing/sitemaps/overview)
            
        *   [Build and submit a sitemap](https://developers.google.com/search/docs/crawling-indexing/sitemaps/build-sitemap)
            
        *   [Manage sitemaps with sitemap index file](https://developers.google.com/search/docs/crawling-indexing/sitemaps/large-sitemaps)
            
        *   Sitemap extensions
            
            *   [Image sitemaps](https://developers.google.com/search/docs/crawling-indexing/sitemaps/image-sitemaps)
                
            *   [News sitemaps](https://developers.google.com/search/docs/crawling-indexing/sitemaps/news-sitemap)
                
            *   [Video sitemaps and alternatives](https://developers.google.com/search/docs/crawling-indexing/sitemaps/video-sitemaps)
                
            *   [Combining sitemap extensions](https://developers.google.com/search/docs/crawling-indexing/sitemaps/combine-sitemap-extensions)
                
            
        
    *   Crawler management
        
        *   [Ask Google to recrawl your URLs](https://developers.google.com/search/docs/crawling-indexing/ask-google-to-recrawl)
            
        *   [Troubleshoot crawl errors](https://developers.google.com/search/docs/crawling-indexing/troubleshoot-crawling-errors)
            
        *   Google crawlers
            
            *   [List of Google crawlers](https://developers.google.com/crawling/docs/crawlers-fetchers/overview-google-crawlers)
                
            *   [Googlebot](https://developers.google.com/search/docs/crawling-indexing/googlebot)
                
            *   [Reduce the Google crawl rate](https://developers.google.com/crawling/docs/crawlers-fetchers/reduce-crawl-rate)
                
            *   [Verifying Googlebot and other Google crawlers](https://developers.google.com/crawling/docs/crawlers-fetchers/verifying-googlebot)
                
            
        
    *   robots.txt
        
        *   [Introduction to robots.txt](https://developers.google.com/search/docs/crawling-indexing/robots/intro)
            
        *   [How Google interprets the robots.txt specification](https://developers.google.com/crawling/docs/robots-txt/robots-txt-spec)
            
        
    *   Canonicalization
        
        *   [What is URL canonicalization](https://developers.google.com/search/docs/crawling-indexing/canonicalization)
            
        *   [How to specify a canonical URL with rel="canonical" and other methods](https://developers.google.com/search/docs/crawling-indexing/consolidate-duplicate-urls)
            
        *   [Fix canonicalization issues](https://developers.google.com/search/docs/crawling-indexing/canonicalization-troubleshooting)
            
        
    *   [Mobile site and mobile-first indexing](https://developers.google.com/search/docs/crawling-indexing/mobile/mobile-sites-mobile-first-indexing)
        
    *   AMP
        
        *   [AMP on Google Search guidelines](https://developers.google.com/search/docs/crawling-indexing/amp)
            
        *   [Understand how AMP works in search results](https://developers.google.com/search/docs/crawling-indexing/amp/about-amp)
            
        *   [Enhance AMP content](https://developers.google.com/search/docs/crawling-indexing/amp/enhance-amp)
            
        *   [Validate AMP content](https://developers.google.com/search/docs/crawling-indexing/amp/validate-amp)
            
        *   [Remove AMP content](https://developers.google.com/search/docs/crawling-indexing/amp/remove-amp)
            
        
    *   JavaScript
        
        *   [Understand the JavaScript SEO basics](https://developers.google.com/search/docs/crawling-indexing/javascript/javascript-seo-basics)
            
        *   [Fix search-related JavaScript problems](https://developers.google.com/search/docs/crawling-indexing/javascript/fix-search-javascript)
            
        *   [Fix lazy-loaded content](https://developers.google.com/search/docs/crawling-indexing/javascript/lazy-loading)
            
        *   [Dynamic rendering as a workaround](https://developers.google.com/search/docs/crawling-indexing/javascript/dynamic-rendering)
            
        
    *   Page and content metadata
        
        *   [Page metadata](https://developers.google.com/search/docs/crawling-indexing/valid-page-metadata)
            
        *   Meta tags
            
            *   [Meta tags and HTML attributes that Google supports](https://developers.google.com/search/docs/crawling-indexing/special-tags)
                
            *   [Robots meta tag, data-nosnippet, and X-Robots-Tag](https://developers.google.com/search/docs/crawling-indexing/robots-meta-tag)
                
            *   [noindex](https://developers.google.com/search/docs/crawling-indexing/block-indexing)
                
            
        *   [rel attributes](https://developers.google.com/search/docs/crawling-indexing/qualify-outbound-links)
            
        
    *   Removals
        
        *   [Control what you share with Google](https://developers.google.com/search/docs/crawling-indexing/control-what-you-share)
            
        *   [Page removals](https://developers.google.com/search/docs/crawling-indexing/remove-information)
            
        *   [Image removals](https://developers.google.com/search/docs/crawling-indexing/prevent-images-on-your-page)
            
        *   [Redacted information](https://developers.google.com/search/docs/crawling-indexing/keep-redacted-information-out)
            
        
    *   Site moves and changes
        
        *   [Redirects and Google Search](https://developers.google.com/search/docs/crawling-indexing/301-redirects)
            
        *   Site moves
            
            *   [Changing your hosting](https://developers.google.com/search/docs/crawling-indexing/site-move-no-url-changes)
                
            *   [Move a site with URL changes](https://developers.google.com/search/docs/crawling-indexing/site-move-with-url-changes)
                
            
        *   [A/B testing](https://developers.google.com/search/docs/crawling-indexing/website-testing)
            
        *   [Temporarily pause or disable a website](https://developers.google.com/search/docs/crawling-indexing/pause-online-business)
            
        
    
*   Ranking and search appearance
    
    *   [Overview](https://developers.google.com/search/docs/appearance)
        
    *   [AI features](https://developers.google.com/search/docs/appearance/ai-features)
        
    *   [Byline dates](https://developers.google.com/search/docs/appearance/publication-dates)
        
    *   [Favicons](https://developers.google.com/search/docs/appearance/favicon-in-search)
        
    *   [Featured snippets](https://developers.google.com/search/docs/appearance/featured-snippets)
        
    *   [Flexible Sampling](https://developers.google.com/search/docs/appearance/flexible-sampling)
        
    *   [Google Discover](https://developers.google.com/search/docs/appearance/google-discover)
        
    *   [Images](https://developers.google.com/search/docs/appearance/google-images)
        
    *   Local features
        
        *   [Business details](https://developers.google.com/search/docs/appearance/establish-business-details)
            
        *   [Top Places List](https://developers.google.com/search/docs/appearance/top-places-list)
            
        *   [Opting out of local search results](https://support.google.com/webmasters/answer/3035947)
            
        
    *   Page experience
        
        *   [Understanding page experience](https://developers.google.com/search/docs/appearance/page-experience)
            
        *   [Core Web Vitals](https://developers.google.com/search/docs/appearance/core-web-vitals)
            
        *   [Interstitials and dialogs](https://developers.google.com/search/docs/appearance/avoid-intrusive-interstitials)
            
        *   [Get started with signed exchanges on Google Search](https://developers.google.com/search/docs/appearance/signed-exchange)
            
        
    *   [Preferred sources](https://developers.google.com/search/docs/appearance/preferred-sources)
        
    *   Ranking systems
        
        *   [A guide to Google Search ranking systems](https://developers.google.com/search/docs/appearance/ranking-systems-guide)
            
        *   [Reviews system](https://developers.google.com/search/docs/appearance/reviews-system)
            
        
    *   Ranking updates
        
        *   [List of ranking updates](https://status.search.google.com/products/rGHU1u87FJnkP6W2GwMi/history)
            
        *   [Core updates](https://developers.google.com/search/docs/appearance/core-updates)
            
        *   [Spam updates](https://developers.google.com/search/docs/appearance/spam-updates)
            
        
    *   [Site names](https://developers.google.com/search/docs/appearance/site-names)
        
    *   [Sitelinks](https://developers.google.com/search/docs/appearance/sitelinks)
        
    *   [Snippets](https://developers.google.com/search/docs/appearance/snippet)
        
    *   Structured data
        
        *   [Understand how structured data works](https://developers.google.com/search/docs/appearance/structured-data/intro-structured-data)
            
        *   [Structured data general guidelines](https://developers.google.com/search/docs/appearance/structured-data/sd-policies)
            
        *   [Enriched search results](https://developers.google.com/search/docs/appearance/enriched-search-results)
            
        *   [Generate structured data with JavaScript](https://developers.google.com/search/docs/appearance/structured-data/generate-structured-data-with-javascript)
            
        *   Feature guides
            
            *   [All structured data features](https://developers.google.com/search/docs/appearance/structured-data/search-gallery)
                
            *   [Article](https://developers.google.com/search/docs/appearance/structured-data/article)
                
            *   [Book actions](https://developers.google.com/search/docs/appearance/structured-data/book)
                
            *   [Breadcrumb](https://developers.google.com/search/docs/appearance/structured-data/breadcrumb)
                
            *   [Carousel](https://developers.google.com/search/docs/appearance/structured-data/carousel)
                
            *   [Course list](https://developers.google.com/search/docs/appearance/structured-data/course)
                
            *   [Dataset](https://developers.google.com/search/docs/appearance/structured-data/dataset)
                
            *   [Discussion forum](https://developers.google.com/search/docs/appearance/structured-data/discussion-forum)
                
            *   [Education Q&A](https://developers.google.com/search/docs/appearance/structured-data/education-qa)
                
            *   [Employer aggregate rating](https://developers.google.com/search/docs/appearance/structured-data/employer-rating)
                
            *   [Fact check](https://developers.google.com/search/docs/appearance/structured-data/factcheck)
                
            *   [Event](https://developers.google.com/search/docs/appearance/structured-data/event)
                
            *   [FAQ](https://developers.google.com/search/docs/appearance/structured-data/faqpage)
                
            *   [Image metadata](https://developers.google.com/search/docs/appearance/structured-data/image-license-metadata)
                
            *   [Job posting](https://developers.google.com/search/docs/appearance/structured-data/job-posting)
                
            *   [Local business](https://developers.google.com/search/docs/appearance/structured-data/local-business)
                
            *   [Math solver](https://developers.google.com/search/docs/appearance/structured-data/math-solvers)
                
            *   [Movie carousel](https://developers.google.com/search/docs/appearance/structured-data/movie)
                
            *   [Organization](https://developers.google.com/search/docs/appearance/structured-data/organization)
                
            *   Shopping
                
                *   [Overview](https://developers.google.com/search/docs/appearance/structured-data/product)
                    
                *   [Product snippet](https://developers.google.com/search/docs/appearance/structured-data/product-snippet)
                    
                *   [Merchant listing](https://developers.google.com/search/docs/appearance/structured-data/merchant-listing)
                    
                *   [Variants](https://developers.google.com/search/docs/appearance/structured-data/product-variants)
                    
                *   [Loyalty program](https://developers.google.com/search/docs/appearance/structured-data/loyalty-program)
                    
                *   [Merchant return policy](https://developers.google.com/search/docs/appearance/structured-data/return-policy)
                    
                *   [Merchant shipping policy](https://developers.google.com/search/docs/appearance/structured-data/shipping-policy)
                    
                
            *   [Profile page](https://developers.google.com/search/docs/appearance/structured-data/profile-page)
                
            *   [Q&A](https://developers.google.com/search/docs/appearance/structured-data/qapage)
                
            *   [Recipe](https://developers.google.com/search/docs/appearance/structured-data/recipe)
                
            *   [Review snippet](https://developers.google.com/search/docs/appearance/structured-data/review-snippet)
                
            *   [Software app](https://developers.google.com/search/docs/appearance/structured-data/software-app)
                
            *   [Speakable](https://developers.google.com/search/docs/appearance/structured-data/speakable)
                
            *   [Subscription and paywalled content](https://developers.google.com/search/docs/appearance/structured-data/paywalled-content)
                
            *   [Vacation rental](https://developers.google.com/search/docs/appearance/structured-data/vacation-rental)
                
            *   [Video](https://developers.google.com/search/docs/appearance/structured-data/video)
                
            
        
    *   [Title links](https://developers.google.com/search/docs/appearance/title-link)
        
    *   Translated features
        
        *   [Translated results](https://developers.google.com/search/docs/appearance/translated-results)
            
        *   [Ad networks and translation-related Google Search features](https://developers.google.com/search/docs/appearance/ad-network-and-translation)
            
        
    *   [Videos](https://developers.google.com/search/docs/appearance/video)
        
    *   [Visual Elements gallery](https://developers.google.com/search/docs/appearance/visual-elements-gallery)
        
    *   Web Stories
        
        *   [Enable Web Stories on Google](https://developers.google.com/search/docs/appearance/enable-web-stories)
            
        *   [Best practices for creating Web Stories](https://developers.google.com/search/docs/appearance/web-stories-creation-best-practices)
            
        *   [Web Story content policy](https://developers.google.com/search/docs/appearance/web-stories-content-policy)
            
        
    *   Early Adopters Program
        
        *   [Package tracking](https://developers.google.com/search/docs/appearance/package-tracking)
            
        *   [Structured data carousels (beta)](https://developers.google.com/search/docs/appearance/structured-data/carousels-beta)
            
        
    
*   Monitoring and debugging
    
    *   [Debug drops in Search traffic](https://developers.google.com/search/docs/monitor-debug/debugging-search-traffic-drops)
        
    *   Monitor with Search Console
        
        *   [Get started with Search Console](https://developers.google.com/search/docs/monitor-debug/search-console-start)
            
        *   [Improve SEO with a bubble chart](https://developers.google.com/search/docs/monitor-debug/bubble-chart-analysis)
            
        *   [Using Search Console and Google Analytics data for SEO](https://developers.google.com/search/docs/monitor-debug/google-analytics-search-console)
            
        
    *   Debug with search operators
        
        *   [Overview](https://developers.google.com/search/docs/monitor-debug/search-operators)
            
        *   [site: search operator](https://developers.google.com/search/docs/monitor-debug/search-operators/all-search-site)
            
        *   [Google Images search operators](https://developers.google.com/search/docs/monitor-debug/search-operators/image-search)
            
        
    *   Preventing and monitoring abuse
        
        *   [Overview](https://developers.google.com/search/docs/monitor-debug/security)
            
        *   [Prevent user-generated spam](https://developers.google.com/search/docs/monitor-debug/prevent-abuse)
            
        *   [Malware and unwanted software](https://developers.google.com/search/docs/monitor-debug/security/malware)
            
        *   [Prevent a malware infection](https://developers.google.com/search/docs/monitor-debug/security/prevent-malware)
            
        *   [Social engineering (phishing and deceptive sites)](https://developers.google.com/search/docs/monitor-debug/security/social-engineering)
            
        *   [Google Safe Browsing Repeat Offenders Policy](https://developers.google.com/search/docs/monitor-debug/security/safe-browsing-repeat-offenders)
            
        
    *   [Get started with Google Trends](https://developers.google.com/search/docs/monitor-debug/trends-start)
        
    
*   Site-specific guides
    
    *   Ecommerce
        
        *   [Overview](https://developers.google.com/search/docs/specialty/ecommerce)
            
        *   [Where content can appear](https://developers.google.com/search/docs/specialty/ecommerce/where-ecommerce-data-can-appear-on-google)
            
        *   [Share product data](https://developers.google.com/search/docs/specialty/ecommerce/share-your-product-data-with-google)
            
        *   [Include structured data](https://developers.google.com/search/docs/specialty/ecommerce/include-structured-data-relevant-to-ecommerce)
            
        *   [Launch a new website](https://developers.google.com/search/docs/specialty/ecommerce/how-to-launch-an-ecommerce-website)
            
        *   [Write high quality reviews](https://developers.google.com/search/docs/specialty/ecommerce/write-high-quality-reviews)
            
        *   [Design a URL structure](https://developers.google.com/search/docs/specialty/ecommerce/designing-a-url-structure-for-ecommerce-sites)
            
        *   [Ecommerce site structure](https://developers.google.com/search/docs/specialty/ecommerce/help-google-understand-your-ecommerce-site-structure)
            
        *   [Pagination, incremental page loading, and Search](https://developers.google.com/search/docs/specialty/ecommerce/pagination-and-incremental-page-loading)
            
        
    *   International and multilingual
        
        *   [Overview](https://developers.google.com/search/docs/specialty/international)
            
        *   [Managing multi-regional and multilingual sites](https://developers.google.com/search/docs/specialty/international/managing-multi-regional-sites)
            
        *   [Tell Google about localized versions of your page](https://developers.google.com/search/docs/specialty/international/localized-versions)
            
        *   [How Google crawls locale-adaptive pages](https://developers.google.com/search/docs/specialty/international/locale-adaptive-pages)
            
        
    *   Explicit content
        
        *   [Guidelines for sites with explicit content](https://developers.google.com/search/docs/specialty/explicit/guidelines)
            
        *   [What to do if your site is incorrectly flagged as explicit](https://developers.google.com/search/docs/specialty/explicit/troubleshooting)
            
        
    

*   SEO fundamentals
*   [Introduction](https://developers.google.com/search/docs)
    
*   [Search Essentials](https://developers.google.com/search/docs/essentials)
    
*   [SEO Starter Guide](https://developers.google.com/search/docs/fundamentals/seo-starter-guide)
    
*   [Optimizing for generative AI search](https://developers.google.com/search/docs/fundamentals/ai-optimization-guide)
    
*   [How Google Search Works](https://developers.google.com/search/docs/fundamentals/how-search-works)
    
*   [Do you need an SEO?](https://developers.google.com/search/docs/fundamentals/do-i-need-seo)
    
*   Crawling and indexing
*   [Sitemaps](https://developers.google.com/search/docs/crawling-indexing/sitemaps/overview)
    
*   [robots.txt](https://developers.google.com/search/docs/crawling-indexing/robots/intro)
    
*   [Meta tags](https://developers.google.com/search/docs/crawling-indexing/special-tags)
    
*   [Crawler management](https://developers.google.com/search/docs/crawling-indexing/ask-google-to-recrawl)
    
*   [Removals](https://developers.google.com/search/docs/crawling-indexing/control-what-you-share)
    
*   [Canonicalization](https://developers.google.com/search/docs/crawling-indexing/consolidate-duplicate-urls)
    
*   [Redirects](https://developers.google.com/search/docs/crawling-indexing/301-redirects)
    
*   [JavaScript SEO](https://developers.google.com/search/docs/crawling-indexing/javascript/javascript-seo-basics)
    
*   Ranking and search appearance
*   [Visual Elements gallery](https://developers.google.com/search/docs/appearance/visual-elements-gallery)
    
*   [Title links](https://developers.google.com/search/docs/appearance/title-link)
    
*   [Snippets](https://developers.google.com/search/docs/appearance/snippet)
    
*   [Images](https://developers.google.com/search/docs/appearance/google-images)
    
*   [Videos](https://developers.google.com/search/docs/appearance/video)
    
*   [Structured data](https://developers.google.com/search/docs/appearance/structured-data/search-gallery)
    
*   [Favicons](https://developers.google.com/search/docs/appearance/favicon-in-search)
    
*   Site-specific guides
*   [Ecommerce](https://developers.google.com/search/docs/specialty/ecommerce)
    
*   [International and multilingual sites](https://developers.google.com/search/docs/specialty/international)
    
*   Data analysis
*   [Get started with Search Console](https://developers.google.com/search/docs/monitor-debug/search-console-start)
    
*   [Debug traffic drops](https://developers.google.com/search/docs/monitor-debug/debugging-search-traffic-drops)
    
*   [Using Search Console and Google Analytics data for SEO](https://developers.google.com/search/docs/monitor-debug/google-analytics-search-console)
    
*   [Get started with Google Trends](https://developers.google.com/search/docs/monitor-debug/trends-start)
    

*   [All updates](https://developers.google.com/search/news)
    
*   [Documentation updates](https://developers.google.com/search/updates)
    
*   [Ranking updates](https://status.search.google.com/products/rGHU1u87FJnkP6W2GwMi/history)
    
*   [New YouTube videos](https://www.youtube.com/channel/UCWf2ZlNsCGDS89VBF_awNvA)
    
*   [Recent podcast episodes](https://pod.link/1512522198)
    

*   [Home](https://developers.google.com/)
    
*   [Search Central](https://developers.google.com/search)
    
*   [Documentation](https://developers.google.com/search/docs)
    

Send feedback

Fix Search-related JavaScript problems
======================================

This guide helps you identify and fix JavaScript issues that may be blocking your page, or specific content on JavaScript powered pages, from showing up in Google Search. While Google Search does run JavaScript, there are some differences and limitations that you need to account for when designing your pages and applications to accommodate how crawlers access and render your content. Our [guide on JavaScript SEO basics](https://developers.google.com/search/docs/guides/javascript-seo-basics)
 has more information on how you can optimize your JavaScript site for Google Search.

Googlebot is designed to be a good citizen of the web. Crawling is its [main priority](https://developers.google.com/search/blog/2017/01/what-crawl-budget-means-for-googlebot)
, while making sure it doesn't degrade the experience of users visiting the site. Googlebot and its Web Rendering Service (WRS) component continuously analyze and identify resources that don't contribute to essential page content and may not fetch such resources. For example, reporting and error requests that don't contribute to essential page content, and other similar types of requests are unused or unnecessary to extract essential page content. Client-side analytics may not provide a full or accurate representation of Googlebot and WRS activity on your site. Use [the crawl stats report in Google Search Console](https://support.google.com/webmasters/answer/9679690)
 to monitor Googlebot and WRS activity and feedback on your site.

If you suspect that JavaScript issues might be blocking your page, or specific content on JavaScript powered pages, from showing up in Google Search, follow these steps. If you're not sure if JavaScript is the main cause, follow our [general debugging guide](https://developers.google.com/search/docs/guides/debug)
 to determine the specific issue.

1.  **To test how Google crawls and renders a URL**, use the [Rich Results Test](https://search.google.com/test/rich-results)
     or the [URL Inspection Tool](https://support.google.com/webmasters/answer/9012289)
     in Search Console. You can see loaded resources, JavaScript console output and exceptions, rendered DOM, and more information.
    
    Optionally, we also recommend collecting and auditing JavaScript errors encountered by users, including Googlebot, on your site to identify potential issues that may affect how content is rendered. Here's an example that shows how to log JavaScript errors that are logged in the [global onerror handler](https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers/onerror)
    . Note that some types of JavaScript errors, such as a parse error, cannot be logged with this method.
    
    window.addEventListener('error', function(e) {
        var errorText \= \[\
            e.message,\
            'URL: ' + e.filename,\
            'Line: ' + e.lineno + ', Column: ' + e.colno,\
            'Stack: ' + (e.error && e.error.stack || '(no stack trace)')\
        \].join('\\n');
    
        // Example: log errors as visual output into the host page.
        // Note: you probably don't want to show such errors to users, or
        //       have the errors get indexed by Googlebot; however, it may
        //       be a useful feature while actively debugging the page.
        var DOM\_ID \= 'rendering-debug-pre';
        if (!document.getElementById(DOM\_ID)) {
            var log \= document.createElement('pre');
            log.id \= DOM\_ID;
            log.style.whiteSpace \= 'pre-wrap';
            log.textContent \= errorText;
            if (!document.body) document.body \= document.createElement('body');
            document.body.insertBefore(log, document.body.firstChild);
        } else {
            document.getElementById(DOM\_ID).textContent += '\\n\\n' + errorText;
        }
    
        // Example: log the error to remote service.
        // Note: you can log errors to a remote service, to understand
        //       and monitor the types of errors encountered by regular users,
        //       Googlebot, and other crawlers.
        var client \= new XMLHttpRequest();
        client.open('POST', 'https://example.com/logError');
        client.setRequestHeader('Content-Type', 'text/plain;charset=UTF-8');
        client.send(errorText);
    
    });
    
2.  **Make sure to prevent [`soft 404` errors](https://developers.google.com/search/docs/crawling-indexing/troubleshoot-crawling-errors#soft-404-errors)
    .** In a single-page application (SPA), this can be especially difficult. To prevent error pages from being indexed, you can use one or both of the following strategies:
    
    *   Redirect to a URL where the server responds with a `404` status code.
        
        fetch(\`https://api.kitten.club/cats/${id}\`)
         .then(res \=> res.json())
         .then((cat) \=> {
           if (!cat.exists) {
             // redirect to page that gives a 404
             window.location.href \= '/not-found';
           }
         });
        
    *   Add or change the robots `meta` tag to `noindex`.
        
        fetch(\`https://api.kitten.club/cats/${id}\`)
         .then(res \=> res.json())
         .then((cat) \=> {
           if (!cat.exists) {
             const metaRobots \= document.createElement('meta');
             metaRobots.name \= 'robots';
             metaRobots.content \= 'noindex';
             document.head.appendChild(metaRobots);
           }
         });
        
    
    When a SPA is using client-side JavaScript to handle errors they often report a `200` HTTP status code instead of the [appropriate status code](https://developers.google.com/search/docs/crawling-indexing/javascript/javascript-seo-basics#use-meaningful-http-status-codes)
    . This can lead to error pages being indexed and possibly shown in search results.
    
3.  **Expect Googlebot to decline [user permission requests](https://w3c.github.io/permissions/#permission-registry)
    .**  
    Features that require user permission don't make sense for Googlebot, or for all users. For example, if you make the `Camera API` required, Googlebot can't provide a camera to you. Instead, provide a way for users to access your content without being forced to allow camera access.
4.  **Don't use URL fragments to load different content.**  
    A SPA may use URL fragments (for example https://example.com/#/products) for loading different views. The [AJAX-crawling scheme has been deprecated](https://developers.google.com/search/blog/2015/10/deprecating-our-ajax-crawling-scheme)
     since 2015, so you can't rely on URL fragments to work with Googlebot. We recommend using the [History API](https://developer.mozilla.org/en-US/docs/Web/API/History)
     to load different content based on the URL in a SPA.
5.  **Don't rely on data persistence to serve content.**  
    WRS loads each URL (refer to [How Google Search Works](https://developers.google.com/search/docs/fundamentals/how-search-works)
     for an overview of how Google discovers content), following server and client redirects, same as a regular browser. However, WRS does not retain state across page loads:
    *   Local Storage and Session Storage data are cleared across page loads.
    *   HTTP Cookies are cleared across page loads.
6.  **Use content fingerprinting to avoid caching issues with Googlebot.**  
    Googlebot caches aggressively in order to reduce network requests and resource usage. WRS may ignore caching headers. This may lead WRS to use outdated JavaScript or CSS resources. Content fingerprinting avoids this problem by making a fingerprint of the content part of the filename, like `main.2bb85551.js`. The fingerprint depends on the content of the file, so updates generate a different filename every time. Check out the [web.dev guide on long-lived caching strategies](https://web.dev/articles/http-cache#versioned-urls)
     to learn more.
7.  **Ensure that your application uses [feature detection](https://developer.mozilla.org/en-US/docs/Learn/Tools_and_testing/Cross_browser_testing/Feature_detection)
     for all critical APIs that it needs and provide a fallback behavior or polyfill where applicable.**  
    Some web features may not yet be adopted by all user agents and some may intentionally disable certain features. For example, if you use WebGL to render photo effects in the browser, feature detection shows that Googlebot doesn't support WebGL. To fix this, you could skip the photo effect or decide to use server-side rendering to prerender the photo effects, which makes your content accessible to everyone, including Googlebot.
8.  **Make sure your content works with HTTP connections.**  
    Googlebot uses HTTP requests to retrieve content from your server. It does not support other types of connections, such as `[WebSockets](https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API) ` or `[WebRTC](https://developer.mozilla.org/en-US/docs/Glossary/WebRTC) ` connections. To avoid problems with such connections, make sure to provide an HTTP fallback to retrieve content and use robust error handling and [feature detection](https://developers.google.com/search/docs/crawling-indexing/javascript/fix-search-javascript#feature-detection)
    .
9.  **Make sure your web components render as expected.** Use the [Rich Results Test](https://search.google.com/test/rich-results)
     or the [URL Inspection Tool](https://support.google.com/webmasters/answer/9012289)
     to check if the rendered HTML has all content you expect.  
    WRS flattens the [light DOM and shadow DOM](https://developers.google.com/web/fundamentals/web-components/shadowdom#lightdom)
    . If the web components you use aren't using [`<slot>` mechanism](https://developers.google.com/web/fundamentals/web-components/shadowdom#slots)
     for light DOM content, consult the documentation of the web component for further information or use another web component instead. For more information, see [best practices for web components](https://developers.google.com/search/docs/guides/javascript-seo-basics#web-components)
    .
10.  **If you're using a JavaScript-based paywall, consider the implementation.**  
    Some JavaScript paywall solutions include the full content in the server response, then use JavaScript to hide it until subscription status is confirmed. This isn't a reliable way to limit access to the content. Make sure your paywall only provides the full content once the subscription status is confirmed.
11.  **After you fix the items in this checklist, test your page** with the [Rich Results Test](https://search.google.com/test/rich-results)
     or the [URL inspection tool](https://search.google.com/search-console)
     in Search Console again.  
    If you fixed the issue, a green check mark appears and no errors display. If you still see errors, post in the [Search Central help community](https://support.google.com/webmasters/community)
    .

Send feedback

Except as otherwise noted, the content of this page is licensed under the [Creative Commons Attribution 4.0 License](https://creativecommons.org/licenses/by/4.0/)
, and code samples are licensed under the [Apache 2.0 License](https://www.apache.org/licenses/LICENSE-2.0)
. For details, see the [Google Developers Site Policies](https://developers.google.com/site-policies)
. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-12-18 UTC.

 *    [![LinkedIn](https://developers.google.com/static/search/images/li.png)LinkedIn](https://www.linkedin.com/showcase/googlesearchcentral/)
    
    Join us on LinkedIn
    
*    [![YouTube](https://developers.google.com/static/homepage-assets/images/yt.svg)YouTube](https://www.youtube.com/channel/UCWf2ZlNsCGDS89VBF_awNvA)
    
    Watch our videos
    
*    [![Blog](https://fonts.gstatic.com/s/i/short-term/release/googlesymbols/rss_feed/default/24px.svg)Blog](https://feeds.feedburner.com/blogspot/amDG)
    
    Subscribe to our RSS feed
    
*    [![Podcast](https://developers.google.com/static/search/images/search-off-the-record-podcast-logo.png)Podcast](https://pod.link/1512522198)
    
    Listen to Search Off the Record
    
*    [![X (Twitter)](https://developers.google.com/static/homepage-assets/images/x.svg)X (Twitter)](https://twitter.com/googlesearchc)
    
    Join us on X (Twitter)

*   ### Get support
    
    *   [Go to the help forum](https://support.google.com/webmasters/community)
        
    *   [Submit a question for office hours](https://developers.google.com/search/help/office-hours)
        
    *   [Report spam, phishing, or malware](https://developers.google.com/search/help/report-quality-issues)
        
    *   [More support resources](https://developers.google.com/search/help)
        
*   ### Resources
    
    *   [Do you need an SEO?](https://developers.google.com/search/docs/fundamentals/get-on-google)
        
    *   [SEO Starter Guide](https://developers.google.com/search/docs/fundamentals/seo-starter-guide)
        
    *   [Status of Search systems](https://status.search.google.com/)
        
    *   [Search Console documentation](https://support.google.com/webmasters)
        
    *   [Case Studies](https://developers.google.com/search/case-studies)
        
*   ### Tools
    
    *   [Search Console](https://search.google.com/search-console)
        
    *   [Rich Results Test](https://search.google.com/test/rich-results)
        
    *   [PageSpeed Insights](https://pagespeed.web.dev/)
        
    *   [AMP Test](https://search.google.com/test/amp)
        

[![Google Developers](https://www.gstatic.com/devrel-devsite/prod/vb08cbdb02acf7f66ad9727ddfba9d81df8806422eb5dd63dba194c9c8c7997f7/developers/images/lockup-google-for-developers.svg)](https://developers.google.com/)

*   [Android](https://developer.android.com/)
    
*   [Chrome](https://developer.chrome.com/home)
    
*   [Firebase](https://firebase.google.com/)
    
*   [Google Cloud Platform](https://cloud.google.com/)
    
*   [Google AI](https://ai.google.dev/)
    
*   [All products](https://developers.google.com/products)
    

*   [Terms](https://developers.google.com/terms/site-terms)
    
*   [Privacy](https://policies.google.com/privacy)
    
*   [Manage cookies](https://developers.google.com/search/docs/crawling-indexing/javascript/fix-search-javascript#)
    

*   English
*   Deutsch
*   Español
*   Español – América Latina
*   Français
*   Indonesia
*   Italiano
*   Polski
*   Português – Brasil
*   Tiếng Việt
*   Türkçe
*   Русский
*   العربيّة
*   हिंदी
*   ภาษาไทย
*   中文 – 简体
*   中文 – 繁體
*   日本語
*   한국어