Content within JavaSccript code
-
I know that it is not a good practice to inlcude SEO content within JavaScript, but are there exceptions to what Google can spider or is it best to just avoid completely?
-
Thank you for the quick responses.
Thanks,
Matthew
-
From my perspective, whenever possible you want to make your JavaScript content degrade gracefully. Basically, if a visitor has JavaScript turned off, they still have access to the content they would see if JavaScript was turned on. This also eliminates the need to worry about whether searchbots can or cannot spider such content.
As an example, consider a JavaScript based image carousel. With JavaScript turned on, the user can cycle through the images in a (usually) user friendly way via the carousel controls. With JavaScript turned off, the user can still see the images, but may have to click on them to see them displayed in the browser window - not as slick, but not bad either.
One key aspect to this type of development is writing well organized markup / code / scripts that allows for your JavaScript to be seperated from your HTML.
A great resource for learning about this is DOM Scripting by Jeremy Keith.
-
Hi Mjmorse,
What do you mean by SEO content? Do you mean that your content is only targeted for search engine spiders?
In case your content is also targeting the actual real users that will visit your website, I suggest you avoid javascript for content in case some of them are using mobile device with limited javascript support.
Plain text content right in the HTML is always preferable over dynamicaly loaded content from JS. Using javascript is usualy a way to hide content to search engines, not the opposite.
Best regards,
Guillaume Voyer. -
A simple javascript that does something like document.write is fine. Google can execute a lot of javascript now. The key is to to webmaster tools and fetch the page as googlebot. Then you can see what Google can see on your page. If you have SEO content in a javascript and Google cannot see it, I would change it. If Google can see it and index it just fine, no problems.
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
Duplicate content in Shopify reported by Moz
According to Moz crawl report, there are hundreds of duplicate pages in our Shopify store ewatchsale.com. The main duplicate pages are:
On-Page Optimization | | ycnetpro101
https://ewatchsale.com/collections/seiko-watches?page=2
https://ewatchsale.com/collections/all/brand_seiko
(the canonical page should be https://ewatchsale.com/collections/seiko-watches) https://ewatchsale.com/collections/seiko-watches/gender_mens
(the canonical page should be https://ewatchsale.com/collections/seiko-watches/mens-watches) Also, I want to exclude indexing of pages URLs with "filter parameters" like https://ewatchsale.com/collections/seiko-watches/color_black+mens-watches+price_us-100-200 Shopify advised we can't access our robots.txt file. How can we exclude SE crawling of the page URLs with filter names?
How can we access the robots.txt file?
How can we add canonical code to the preferred collection pages? Which templates and what codes to add? Thanks for your advice in advance!0 -
Can Google read this code?
I'm working on some basic on-page SEO content for a website within my company and I need some guidance as far as 1. whether Google can read the small amount of existing text (not optimized) and if it isn't spiderable, then 2. what code should be there instead. Here is the site: https://www.le-velgear.com/store/catalog The text I'm referring to is toward the bottom of the page (isn't it always?) and says this: Designed for a Thriving Lifestyle The Le-Vel Gear store is an extension of the LV Life, the Thrive product line, and the world's largest health and wellness Movement, which you helped create. Living a life you deserve includes looking good while showing the world your pride in being a Thriver...Check out all the new and incredible gear and tools and take your Thriving lifestyle to the next level!!! When I "View Source," I cannot see the text, however, the text is highlight-able with my cursor and I can see it when I "Inspect Element" in a container that says Thanks in advance for any help!
On-Page Optimization | | lizzyr0 -
Is minor duplicate content on my website okay?
I know duplicate content across multiple websites is not a good thing, however I've always wondered about minor duplicate content on your own website. I know its good practice to have unique content on each page but what about the little stuff. For example on our website certain related pages share the same content in a right sidebar. Such as links to pdf leaflets, or "you can read our blog etc" . Is there a minimum number of repeated words required before its flagged as duplicate content? Another example is a customer gave two testimonials for two of our employees - the testimonials were identical other than the employee names - if these were posted on separate pages is it a problem for the site as a whole or for both those individual pages? Thanks
On-Page Optimization | | Brabian0 -
Modifying Well Established & Well Indexed Content
I have a page that is very well indexed and has a 1st position ranking in google. It is the best landing page in my site. That being said, it's several years old and I honestly think it could be better. The images could be enlarged, the the images could have fancy box enlargements instead of just linking out to flickr, there could be more content about follow up projects that people have done. I'm noteably nervous about changing such a clutch piece of content on my site. I do want to improve the content for users, not just make it more SEO friendly (it's already SEO'd), but I'm afraid that any change could cause a set back in ranking. Am I being afraid of nothing, should I just go for it and improve my content, or should I be extra cautious when editing well indexed content like this? Thanks for the advice
On-Page Optimization | | CPollock0 -
Duplicate Page Content for Product Pages
Hello, We have one website which URL is http://www.bannerbuzz.com & we have many product pages which having duplicate page content issue in SEOMOZ which are below. http://www.bannerbuzz.com/backlit-banners-1.html
On-Page Optimization | | CommercePundit
http://www.bannerbuzz.com/backlit-banners-10.html
http://www.bannerbuzz.com/backlit-banners-11.html
http://www.bannerbuzz.com/backlit-banners-12.html
http://www.bannerbuzz.com/backlit-banners-13.html We haven't any content on these pages, still getting duplicate page content errors for all pages in SEOMOZ. Please help me how can i fix this issue. Thanks,0 -
Linking within Secondary Site
So we've got a secondary site that has quite a bit of authority & links that used to have all types of info on parasailing. All those pages are gone and homepage is now a salespage (management decision, not mine) Our main site sells a wide range of tours and activities and does have a page for parasailing. The secondary site uses the same template/navigation as our main site (again, not my decision). Do you think that's an effective way to send link juice to our main site? The secondary site has some pretty awesome high authority sites linking to it. I've considered 301'ing the whole site to our main site but it's got a really solid domain name and I'd like to take up 2 SERP listings (main and secondary site) Is there a better way to have double listings but still send a good amount of link juice?
On-Page Optimization | | SoulSurfer80 -
Duplicate content on homepage?
Hi I have just created a new campaign and it states that I have duplicate page content which would affect search rankings. Basically it is counting my site www.mydomain.com and www.mydomain.com/index.php as two seperate pages. How can I make it so that only www.mydomain.com is visible reducing the duplicate content issue? Many Thanks
On-Page Optimization | | idv0 -
Only showing googlebot schema.org tagged content - cloaking??
Would it be considered cloaking if I only show schema.or tagged content to searchengine bots and not to regular visitors. Mind you, no other change on the page, design or content. So instead of Googlebot would be served: 41 Main Street Regular visitors: 41 Main Street
On-Page Optimization | | Sebes0