Skip to main content
3 of 3
spelling, code format example URL, title clarity
Stephen Ostermiller
  • 99.4k
  • 18
  • 141
  • 364

Is it OK for SEO to make content available via AJAX when users click, but also to load that content on its own URL?

I'm working on a website and I want to use AJAX for some content, but I'm worried about search engines crawling my site, and I know Google and other search engines only see contents that are currently in the DOM.

What if I use AJAX but the contents also will be available in DOM after requests?

For example, I have a link called "Article 234" with the URL: https://example.com/?p=234. When the client clicks on the button it will load the contents from that article with AJAX but also if the user opens that URL sees the content, is it OK?

Something like this:

$("#article-234").click(e => {
    // Not redirecting
    e.preventDefault();

    // Instead, get content with ajax
    loadAjax(234);
});