Javascript is not suitable for SEO, is it?

If I decide to use some kind of javascipt on my website, for example

$('#body').load(URL); 

or

 $.get(URL, {param:value}, function(){ ... }); 

or

 window.title = 'TEXT'; 

Is this good for SEO? Or do I recommend using pure PHP for the data on the page for SEO purposes?

+4
source share
8 answers

The question of whether JavaScript is good for SEO or not makes no sense. We should pretty much assume that any content available only for javascript will not be crawled by search engines. Google, at least, claims to be able to crawl some content only in javascript, but is pretty tough on the fact that they can crawl. Other search engines probably do not crawl it, and this is certainly the case that not everything does. Suppose he does not go around.

This does not mean that it is bad for SEO.

If the content will contribute to your SEO, then this is bad for SEO. If the content is neutral for SEO, then it is neutral for SEO. So the answer to your question really depends on the nature of your content. If content is part of your SEO campaign, then stick with server-side HTML generation, whether it's PHP or some other method. Otherwise, the SEO question has nothing to do with the decision to use javascript or not. Accessibility would be another thing to consider. For Javascript only, this is terrible.

+4
source

I think you should first think about what SEO means. This means "Search Engine Optimization" ... how does a search engine get data primarily for optimization?

This does a GET on the page and all data returned to the GET is processed. No JS engine. No POST data. Therefore, you must be optimized for any data returned to the GET.

Also, you noted this with PHP, but the question has nothing to do with PHP.


Have you seen any questions from this list?
https://stackoverflow.com/search?q=javascript+seo

+2
source

Larger search engines can / do render a limited amount of javascript. However, for SEO purposes, your best bet is to provide content via HTML rather than javascript. A good rule of thumb is to use HTML for content / expressing a limited content structure (e.g. paragraph type text = p, lists = ul / ol, headings = h1 / h2 / h3, etc.), CSS for presentation, and JS for external programming customer. With that said, always provide a good user experience first. If you can do the above by providing great user experience, great! If you cannot, first specify the users. You can probably save both users and bots in 95% of cases if you spend time on it.

Further reading (sorry, I can only post one link as a new user):

Matt Cutt Interview (Checkout # 26 on Google Javascript Rendering)
Web 2.0 Spider View


EDIT Added that for the "new user" ;) ~ drachenstern

+2
source

No sir, Google does not translate the flash and java script correctly, so it cannot bypass this area using java script or flash content. I suggest you keep your site simple, but if you need to save flashy / java script content, you should keep the text base.

+2
source

The first thing you need to ask is not what is good for SEO, but what is good for users. For users, loading data using JavaScript will give them an interactive page where they can immediately see the page while it is still loading, and where the page can be updated without reloading.

From Google ’s Webmaster Guide and article on Cloaking , you should not assume that crawlers can understand JavaScript. This does not mean that you should not use JavaScript on your website, but rather should provide the text equivalent in noscript tags, for use as users with JavaScript disabled and for crawlers, bearing in mind that the content of these noscript tags should be approximately equivalent to what was shown with JavaScript enabled; showing various content for users and search engines is called “cloaking” and is at least underestimated.

0
source

Google has not yet implemented the Javascript (JS) page. Therefore, if your JS replaces / creates content on the page, then the content will usually be invisible to crawlers (not good).

But, the Googlers have implemented a URL that allows your server to create pages (from the server, not from JS), with all of the various content options for your JS page.

This solves the SEO problem on pages powered by Ajax. At least for google search ...

See Crawable Ajax

0
source

Javascript or any scripts, for that matter, should never be used to host the content of your sites! The whole network is controlled by HTML and CSS, and in rare cases, with XML languages, everything else is a headache when it comes to SEO. Ask yourself this question: what is SEO and what does it index search engines? Javascript and all programming / scripting languages ​​are proprietary, which means that they are NOT standards defined by the W3C, which means that they are practically worthless when it comes to indexing content. HTML, CSS, and XML, on the other hand, are true standards designed for the web! It’s good to use scripts to add additional features to your pages, embed applications such as social media plugins, etc., but you should never use them to store your HTML, CSS or actual website websites for any reason. Here is a link to a good article that will explain why you should use HTML and CSS, and not a million scripts, to optimize web pages using proper html markup . Scripts cause other problems besides code that is difficult to decrypt by search engines. Firstly, they are more difficult to handle browsers, which leads to page loading much slower than the "static" pages made using HTML and CSS. Pages created using PHP tend to create a “dynamic” URL that users and search engines cannot read. This is why Google recommends that people who use jsp or PHP for their web pages include a sitemap, otherwise your links will never be found and may not exist either. Stick to conventions! Let's face it, we have standards for some reason. If each electronic component in your home had a different type of plug that required special wear, and all of these devices had different voltage and voltage requirements, what would happen? You essentially burn your house! And you would spend 5 hours a day in the hardware store looking for these special adapters to fit your wall outlets. If you plan to create a website, use scripts to deploy applications or connect only to the database, and use HTML and CSS to create “static” web pages. Also, use text links, as they are readable in both human and search engines, and are easily indexed and make sense. Never use scripts for your links. Programming and scripting can be fun, but not on the Internet - no.

The search engine index HTML, CSS and content (multimedia, graphics, video, text, that's all!) Everything else is pointless and annoying both users and search engines. For best results, use XML and create a custom language.

0
source

Google can crawl, index, and rank generated JavaScript content. But ... it uses the old version of Chrome (42) with the old JavaScript rendering engine.

The consequence of this is that your JavaScript code should work in older browsers and older versions of Chrome (older than 42). So no unusual ES6 features, you need to use polyphiles or Babel, for example.

Although you can do a lot with javascript (for example, click events or implementing a mobile menu), it is recommended that you still use a-href instead of the javascript event button, and then use the function to go to a new page.

You can check the mobile testing tool on Google: https://search.google.com/test/mobile-friendly and check for errors / warnings / logs. If the rendering result looks as intended, Google will see your content.

In the search console, you can also ask to index the page. Sometimes a javascript scanner is the first, sometimes a “classic” scanner.

Check it out a few days later, using the help of a sentence or paragraph from your page.

There is no answer as to whether this is better or not. Content is content, and Google must rank your site, SPA, PWA, AMP site, PDF document, online document, wiki page, etc. Depending on their content, and not on the underlying technology.

If you are familiar with JavaScript, try it.

Regards, Peter

0
source

Source: https://habr.com/ru/post/1333446/


All Articles