2

I am loading the content of main article using jQuery . Is it effective for SEO? Is it bad practice?

For example I have a page URL example.com/ariticle?seid=14

Here when the page loads, I fetch the content using AJAX and jQuery. When the user gets the page, the common template is the first thing to load. Inside this template <body>, I have a <div> and it's class is main-article. During the document.ready function I get the selected news article id frome the URL (seid=14) & then fetch its corresponding content from the database and show it inside the class main-article.

If doing this is bad for SEO, how can I make my individual posts more SEO friendly?

Google has an AJAX crawling scheme, but it is deprecated now.

3

How to achieve SEO for XHTML pages which load data in DOM using a JQuery-AJAX service calls?

You can load any data with Ajax call. For example, this site changes the title of all pages (it could be a meta tag too) with JavaScript and Google indexes them correctly. This site uses the "escaped URL fragments" method to be indexed.

Edit: if you click through in the link you posted, you'll find the reason it's deprecated and on that page is this:

Times have changed. Today, as long as you're not blocking Googlebot from crawling your JavaScript or CSS files, we are generally able to render and understand your web pages like modern browsers

Edit2: AJAX isn't bad for SEO, but I'd consider rewriting those links. /article/id/title-of-the article or something similar is a lot better than ariticle?seid=14.

  • I agree with this answer. These days Googlebot does a very good job indexing text that is loaded via JavaScript on page load. Other search engines aren't quite as sophisticated though. – Stephen Ostermiller May 22 '17 at 15:18
  • And text only browsers that don't support JavaScript won't be able to read it. Best practice is to have a fall back. For those and crawlers who can't crawl JavaScript rendered content. – Abu Nooh May 22 '17 at 21:49
1

Pushstate

You can use pushstate to dynamically change the url, so that your dynamic content is accessible and crawable. So if the user browses article2, you can update the title and url to article2. Pushstate will maintain browser history.

http://example.com/article/1 -> this will go to article1
http://example.com/article/2 -> this will go to article2

Here is a good article by bing regarding pushstate

https://blogs.bing.com/webmaster/2013/03/21/search-engine-optimization-best-practices-for-ajax-urls/

You can also see a sample website using pushstate()

http://html5.gingerhost.com/

Check content is proper for google bot

You can change your user agent in chrome developers tool to Googlebot and check if the content is being viewed properly.

Google bot

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.