Does Baidu read JavaScript?
It has a rendering crawler, but nothing shows you can rely on it.
The short answer
Not in a way you should rely on. Baidu announced a rendering crawler in 2017, but we found no statement of how much JavaScript it runs. Its guides ask for text in the HTML, and two injection tests, from 2018 and 2020 and read as search excerpts, show Baidu missing injected content. Serve titles, body text and links as HTML.
- Baidu announced the Baiduspider-render agent on March 24, 2017, as a beta on selected quality sites.
- Baidu's guide, updated in March 2019, says pages linked only from JavaScript may not be indexed.
- A February 2020 Salt.agency test, read only as a search excerpt, recorded no for Baidu on all 4 injection methods.
- Baidu's 2017 white paper advises keeping page source within 128k, which matters for server-rendered pages too.
- Baidu's crawl diagnosis tool allows 70 uses per site per week and shows the first 200KB.
Most guides settle this in one line, either “Baidu can’t” or “Baidu struggles.” Few show what that line rests on, and the evidence is older and thinner than they suggest.
This page sets it out by date, then shows what to change on your site. It’s part of our guide to Baidu SEO and how it differs from Google.
Does Baidu run JavaScript at all?
Baidu has a crawler built for it, but we found no statement of what that crawler actually does. We also found no one outside Baidu who can show how far it goes.
On March 24, 2017, Baidu announced a new agent, Baiduspider-render, to access the CSS, JavaScript and images of websites.1 It started as a beta on a selection of quality sites.1
The notice’s title calls this rendering crawl, but its text only says Baidu needs to access those files. It doesn’t say which scripts run, how long they get, or which sites are covered.
We found no later Baidu notice that widens the beta, ends it or sets out limits. One bot directory says it was designed to render JavaScript-heavy pages, but cites no test.31
Verdict
Baidu has a rendering agent. Whether it renders your pages is unknown, so don’t build on it.
What the evidence says, by date
The tests point one way, and the newest Baidu text we found on this is from 2019. Here is what we found, with the weak items labeled.
| Date | Source | Kind | What it found |
|---|---|---|---|
| Oct 2016 | freeCodeCamp 12 | site: check, one client-rendered site | A follow-up test counted 1 Baidu result for preactjs.com, against 17 on Google |
| Mar 2017 | Baidu 1 | Official notice | Render agent in beta on selected sites |
| Aug 2017 | Baidu engineer 4 | Official talk | Don’t load titles, dates or body text with JS |
| About Aug 2017 | Bartosz Goralewicz 13 | Controlled test | No Baidu result: the test site wasn’t indexed there when he published |
| Nov 2017 | Baidu white paper 5 | Official guide | JS-loaded mobile pages are more prone to thin content |
| May 2018 | V2EX forum thread 34 | Opinions, no logs | Posters disagree: one says Baidu had begun running JS, others say Vue and React pages won’t get indexed |
| Summer 2018 | Unless 9 | Controlled test, search excerpt | Baidu didn’t seem to recognize any injected content |
| Mar 2019 | Baidu 23 | Official guide | JS content can’t be searched, and content Baidu can’t parse gets discarded |
| Aug 2019 | Chinafy 10 | Ranking correlation | No link between dynamic content and Baidu rank |
| Nov 2019 | Botify 11 | Vendor claim, no source given | Baidu renders JavaScript, “albeit selectively” |
| Feb 2020 | Salt.agency 8 | Controlled test, search excerpt | No for Baidu on all 4 injection methods |
| 2026 | Marketing to China, SEO Sherpa 1416 | Agency claims, no test | Baidu “struggles” with JS sites |
Read it with care, for three reasons:
- Nothing recent. The latest test we found is from February 2020. Baidu may have changed since then, and we found no published retest.
- Test pages. The injection tests use purpose-built pages, which Baidu may treat differently from your site.
- Partial reading. We could read the Salt.agency and Unless results only as search excerpts, so we can’t report their full setup.
Access is one practical barrier. Goralewicz wrote that he couldn’t get his test site indexed on Baidu, and said you need a mainland China phone number to do it.13
Our page on the Baidu account and phone number problem covers that.
What Baidu’s own documents tell you to do
Baidu’s written advice is consistent: put what matters in the HTML, and keep JavaScript for interaction. These texts are old, but we found nothing that replaces them.
| Part of the page | What Baidu says | Date |
|---|---|---|
| Title, date, body text | Don’t load them with JS, it works against the Spider’s assessment 4 | 2017 |
| Important content and links | Use text, not JS 2 | 2019 |
| Pages linked only from JS | Baidu may not be able to index them 2 | 2019 |
| Navigation and body text | Keep them out of Ajax, which is for user interaction 2 | 2019 |
| Prices | Prices output by JS are unfriendly to the spider and hard to use in search 6 | 2017 |
| Redirects | A JS redirect Baidu can’t recognize is listed as a crawl anomaly 318 | 2019 |
There’s a tension here. The guide, last updated in 2019, says search engines can’t identify content in JavaScript,2 two years after the render agent.1 We found no text from Baidu that reconciles the two.
The advice still holds either way, because HTML works whatever the render agent does.
Does JavaScript hurt rankings on its own?
Nothing we found shows that it does. The risk is content Baidu can’t see, not the presence of scripts.
Chinafy’s 2019 study found no correlation between how dynamic a page was and its Baidu rank.10
Treat that as a rough signal. It compared rank with page content before and after Ajax, so it didn’t test what Baidu reads. It also dropped 23 all-JavaScript pages, and its write-up still contains unfilled placeholders.10
Baidu itself tells developers how to use JavaScript well. Its 2019 performance guide recommends defer first, then async, and splitting out the small amount of code the first screen needs.21
The danger is a page that looks empty:
- Baidu’s 2023 list of low-quality pages includes pages that open normally but have no content.28
- Its 2017 white paper warns that JS-loaded mobile pages are more prone to thin content.5
- Its 2019 guide says very slow pages may also be treated as thin.3
That last point matters for sites hosted abroad. See how to speed up your website in China, and check that no script depends on blocked Google services.
Free check
Is your website visible on Baidu?
Enter your website. We check Baidu, access from China and how your site is set up, then email you the report.
Request received
We will send your report by email.
Which rendering setup to use for Baidu
Choose any setup that puts your text and links in the first HTML response. The framework doesn’t matter, as long as the output does that.
| Setup | Text in first HTML? | For Baidu |
|---|---|---|
| Static generation | Yes | Simplest fit for marketing sites and blogs |
| Server-side rendering (Next.js, Nuxt 14) | Yes | Fits Baidu’s advice, and suits pages that change often |
| Classic CMS with some scripts | Usually | Fine, but check tabs, “load more” and filters |
| Prerendering for crawlers only | For crawlers | A workaround, see below |
| Client-side only | No | The case Baidu’s guides warn against |
Prerendering for crawlers. This means detecting bots and serving them a separate rendered copy. Google calls it a workaround, and recommends server rendering, static rendering or hydration.20
We found no Baidu rule that bans or approves it. The 2017 white paper does address pages optimized for crawlers: stay within 128k and put the main content first.5
A guest article Baidu published in 2015 favors the same page for people and spiders.17 If you use prerendering anyway, keep the content identical.
Is the text in the source code?
Yes: check the page weight.
No, brochure site or blog
Static generation
No, content that changes often
Server rendering
Rebuild impossible in the short term
Prerendering for bots, identical content
The trap in server rendering: page size
Server rendering can create a Baidu problem of its own. Baidu’s 2017 white paper says source over 128k may be cut off during crawling, and it advises staying within that.5
Its example is telling. A site generated its main content with JS, so it built a crawler version with base64 images inside the HTML, placed before the text. The page reached 164k.
The crawler cut the page off, it was judged thin, and it wasn’t indexed.5
Rendered pages often carry inline data and styles as well, so check the size of the source, not just the transfer.
Links and URLs
Render navigation as real <a href> links in the HTML, because pages reachable only through JavaScript may not get indexed.2
The 2016 count of preactjs.com fits that. The person who ran it suspected that engines other than Google indexed the page but didn’t follow its links.12
Use real paths and not # routes. The 2015 guest article argued for URLs without the hash.17 That’s dated advice from a practitioner, not a Baidu rule.
Use server redirects and not script redirects, given how Baidu lists JS redirects.318
How to test what Baidu gets from your site
Start with the checks that need no account, then move to Baidu’s own tool. The first two steps take minutes.
-
View the source. Open
view-source:on a key page, not the inspector. Search for your H1, a sentence of body text and your main links. -
Fetch it without a browser. A plain request runs no JavaScript, so it shows the first response. This one uses Baidu’s published user agent:1
curl -s -A "Mozilla/5.0 (compatible; Baiduspider-render/2.0; +http://www.baidu.com/search/spider.html)" https://example.com/page/ | wc -cDrop
| wc -cto read the HTML. Keep the pipe to count its size in bytes, for the 128k check. -
Run crawl diagnosis. The tool shows what the spider fetched, for PC and mobile.732 It allows 70 uses per site per week and shows the first 200KB.7 Baidu cut the quota from 200 in July 2020, and said the tool tests crawling and doesn’t affect indexing.29
-
Check your logs. Look for
Baiduspider-render, then confirm the IP by reverse DNS. Real hosts end in.baidu.comor.baidu.jp.19 A hit shows a fetch, not that the content was indexed.
The tool sits under Baidu’s site resources menu,24 and you need a verified site. Our guide to setting up Baidu Webmaster Tools covers that.
Run your own marker test
You can’t view Baidu’s stored copy anymore, since its snapshot feature disappeared in August 2022.23 And site: is only an estimate.25
A marker test is the closest thing to a direct answer. We haven’t run this one ourselves yet.
- Build one test page. Use your normal template, with enough real content to be worth indexing.
- Add two made-up strings. Put one in the HTML, and have a script insert the other after load. Neither should exist elsewhere online.
- Link and submit the page. Baidu says submission doesn’t guarantee indexing,26 and it gives no timetable.27
- Wait for the page to appear. Our guide on checking which pages Baidu has indexed shows how.
- Search for each string. If the HTML string appears and the script string doesn’t, Baidu hasn’t indexed the injected text on that page.
The result covers one page, on one date. If rendering is selective, as Botify claimed in 2019,11 your next page may behave differently.
If a page is missing entirely, JavaScript may not be the cause. Start with why your site isn’t showing on Baidu.
For phones, see Baidu mobile SEO as well.
The bottom line
Baidu has had a rendering agent since 2017, and we found no statement of how much it does. The two controlled tests that reached a result show Baidu missing injected content, though neither is recent.
So treat JavaScript as a bonus, not a delivery method. If your text and links are in the first HTML response, the question stops mattering.
How Index in China can help
We translate your site into Simplified Chinese with a human reviewer, handle its submission to Chinese search engines where the account allows it and send a monthly report on Chinese traffic.
Tell us early if your site depends on client-side JavaScript, because that shapes the work.
We don’t promise rankings or traffic. See what we do.
Book a 30-minute callCommon questions
Can Baidu index a React or Vue site?
It can, if the server sends the content. The framework isn't what matters, the first HTML response is. A React or Vue site rendered on the server looks like any other page to a crawler. Built only in the browser, it may arrive as a nearly empty shell, which is the case Baidu's guides warn against.
Will moving to server-side rendering get my pages indexed?
It removes one obstacle, nothing more. Baidu doesn't guarantee indexing for any page, and it weighs content quality as well. Your site also has to be reachable from China, and it needs Chinese content people search for. Treat the move as a precondition for testing Baidu, and not as a result in itself.
Does this apply to Bing, 360 and Sogou in China?
It differs by engine. Dragon Metrics said in 2021 that Bing crawls with a current Chromium browser, so it can render JavaScript,22 though a 2020 test excerpt calls it inconsistent.8 We found no usable evidence on 360 or Sogou. HTML that already contains the content avoids the question on every Chinese search engine.
Will analytics or chat scripts hurt my Baidu indexing?
We found no Baidu text saying so. Its own Tongji analytics is installed through code on your pages,30 and its performance guide tells developers to load scripts with defer or async.21 The practical risk is different: a third-party script blocked in China can stall the page for your visitors, so check each one.
Do I need Baidu's JavaScript auto-push snippet?
No. Baidu took its auto-push entry offline in December 2020, saying it would give notice if it returned.29 We found no such notice, so treat guides that recommend the snippet as out of date. It only reported URLs anyway. Baidu's 2020 manual lists API, sitemap and manual submission, all for verified sites.33
Sources
- Baidu: Notice on the new rendering crawl user agent (Chinese)
- Baidu: Search Engine Optimization Guide 2.0 (Chinese)
- Baidu: How the search engine works (Chinese)
- Baidu: Search lecture on the new mobile rules, talk by a platform engineer (Chinese)
- Baidu: Mobile search site optimization white paper, site optimization chapter (Chinese)
- Baidu: Mobile search site optimization white paper, tools chapter (Chinese)
- Baidu: Crawl diagnosis tool page (Chinese)
- Salt.agency: Can all search engines index JavaScript content? (search excerpt only, page returned a 404)
- Unless: JavaScript indexing test (search excerpt only, results did not load)
- Chinafy: If Baidu can't crawl dynamic sites, do pages heavy with Ajax and JS perform worse in SEO?
- Botify: International search engines, SEO for Baidu, Yandex and Naver
- freeCodeCamp: SEO vs. React, is it necessary to render React pages in the backend?
- Bartosz Goralewicz: Going beyond Google, are search engines ready for JavaScript crawling and indexation? (apparently a repost of a Moz article)
- Marketing to China: Baidu SEO vs Google SEO
- Marketing to China: Why your website doesn't rank on Baidu
- SEO Sherpa: Baidu SEO guide
- Baidu Search Academy: Guest article on single-page applications by a Ctrip SEO lead (Chinese)
- Baidu: Crawl anomalies tool notice (Chinese)
- Baidu: Baiduspider FAQ
- Google: Dynamic rendering as a workaround
- Baidu: Website page performance optimization guide (Chinese)
- Dragon Metrics: JavaScript crawling now in beta
- Sina Tech: Report on the end of Baidu's snapshot feature (Chinese)
- Baidu: Search Resource Platform user guide (Chinese)
- Baidu: Note on the site: operator (Chinese)
- Baidu: Normal indexing submission tool (Chinese)
- Baidu: Indexing Q&A (Chinese)
- Baidu: Note on violating and low-quality pages (Chinese)
- Baidu: Tool update log (Chinese)
- Baidu Tongji: Getting started (Chinese)
- Centinel Analytica: Baiduspider-render crawler profile
- Baidu: Platform tools explained, including crawl diagnosis (Chinese)
- Baidu: Platform tools manual, normal indexing chapter (Chinese)
- V2EX: Forum thread on whether a Vue site can be indexed (Chinese)