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
-
Word Count - Content site vs ecommerce site
Hi there, what are your thoughts on word count for a content site vs. an ecommerce site. A lot of content sites have no problem pushing out 500+ words per page, which for me is a decent amount to help you get traction. However on ecommerce sites, a lot of the time the product description only needs to be sub-100 words and the total word count on the page comes in at under 300 words, a lot of that could be considered duplicate. So what are your views? Do ecommerce sites still need to have a high word count on the product description page to rank better?
On-Page Optimization | | Bee1590 -
Avoiding Duplicate Title Tags and Duplicate Content
Hi - I have a question on how to both avoid duplicate title tags and duplicate content AND still create a good user experience. I have a lot of SEO basics to do as the company has not done any SEO to this point. I work for a small cruise line. We have a page for each cruise. Each cruise is associated with a unique itinerary. However the ports of call are not necessarily unique to each itinerary. For each port on the itinerary there are also a set of excursions and if the port is the embark/disembark port, hotels that are associated. The availability of the excursions and hotels depends on the dates associated with the cruise. Today, we have two pages associated with each cruise for the excursions and hotels: mycruisecompany.com/cruise/name-of-cruise/port/excursion/?date=dateinport mycruisecompany.com/cruise/name-of-cruise/port/hotel/?date=dateinport When someone navigates to these pages, they can see a list of relevant content. From a user perspective the list I see is only associated with the relevant date (which is determined by a set of query parameters). Unfortunately, there are situations where the same content is on multiple pages. For instance the exact same set of hotels or excursions might be available for two different cruises or on multiple dates of the same cruise. This is causing a couple of different challenges. For instance, with regard to title tags, we have <title>Hotels in Rome</title> multiple times. I know that isn't good. If I tried to just have a hub page with hotels and a hub page with excursions available from each cruise and then a page for each hotel and excursion, each with a unique title tag, then the challenge is that I don't know how to not make the customer have to work through whether the hotel they are looking for is actually available on the dates in question. So while I can guarantee unique content/title tags, I end up asking the user to think too much. Thoughts?
On-Page Optimization | | Marston_Gould1 -
Duplicate Content
I have a question about duplicate content. (auto generated text).
On-Page Optimization | | affigroup
Will google consider page 1 and page 2 as duplicate content? Page 1. You will find all the Amazon coupon codes and Amazon discount codes currently available listed below, if Amazon doesn't currently have any coupons available you may want to check for Amazon deals or find related coupon codes or promotional codes for similar online stores selling the same products as amazon.
We always have the latest coupon codes for Amazon which are updated daily, so if you can't find any Amazon coupons here then you won't find them anywhere else.
Shop online today at Amazon, and take advantage of the coupon codes that Amazon currently has on offer, these coupon codes, offer codes, and promo codes for Amazon may never be available again. Page 2. You will find all the Target coupon codes and Target discount codes currently available listed below, if Target doesn't currently have any coupons available you may want to check for Target deals or find related coupon codes or promotional codes for similar online stores selling the same products as Target.
We always have the latest coupon codes for Target which are updated daily, so if you can't find any Target coupons here then you won't find them anywhere else.
Shop online today at Target, and take advantage of the coupon codes that Target currently has on offer, these coupon codes, offer codes, and promo codes for Target may never be available again.0 -
Duplicate Content Issue in Magento
Hi I need help in resolving the duplicate content issue on my magento site I got a product My main product url is https://www.oakfurnitureking.co.uk/shop-by-product/boston-solid-oak-4-drawer-chest and it got variation of url see below that are causing duplicate content issue , I have inserted the canonical tag on the below url and my main url is https://www.oakfurnitureking.co.uk/shop-by-product/boston-solid-oak-4-drawer-chest but still moz is showing it as duplicate content. Help Please <colgroup><col width="1003"></colgroup>
On-Page Optimization | | Adnan.Hassan.Khan
| https://www.oakfurnitureking.co.uk/product/oak-bedroom-furniture/boston-solid-oak-4-drawer-chest |
| https://www.oakfurnitureking.co.uk/catalog/product/view/id/45/s/boston-solid-oak-4-drawer-chest/category/6/ |
| https://www.oakfurnitureking.co.uk/catalog/product/view/id/45/s/boston-solid-oak-4-drawer-chest/category/17/ |
| https://www.oakfurnitureking.co.uk/shop-by-range/boston/boston-solid-oak-4-drawer-chest |
| https://www.oakfurnitureking.co.uk/catalog/product/view/id/45/s/boston-solid-oak-4-drawer-chest/category/42/ |
| https://www.oakfurnitureking.co.uk/catalog/product/view/id/45/s/boston-solid-oak-4-drawer-chest/category/63/ |
| https://www.oakfurnitureking.co.uk/catalog/product/view/id/45/s/boston-solid-oak-4-drawer-chest/category/67/ |
| https://www.oakfurnitureking.co.uk/catalog/product/view/id/45/s/boston-solid-oak-4-drawer-chest/category/46/ |
| https://www.oakfurnitureking.co.uk/catalog/product/view/id/45/s/boston-solid-oak-4-drawer-chest/category/79/ |
| https://www.oakfurnitureking.co.uk/catalog/product/view/id/45/s/boston-solid-oak-4-drawer-chest/category/88/ |
| https://www.oakfurnitureking.co.uk/catalog/product/view/id/45/s/boston-solid-oak-4-drawer-chest/category/75/ |
| https://www.oakfurnitureking.co.uk/catalog/product/view/id/45/s/boston-solid-oak-4-drawer-chest/category/90/ |
| https://www.oakfurnitureking.co.uk/catalog/product/view/id/45/s/boston-solid-oak-4-drawer-chest/category/92/ |
| https://www.oakfurnitureking.co.uk/catalog/product/view/id/45/s/boston-solid-oak-4-drawer-chest/category/33/ |
| https://www.oakfurnitureking.co.uk/catalog/product/view/id/45/s/boston-solid-oak-4-drawer-chest/category/27/ |
| https://www.oakfurnitureking.co.uk/shop-by-range/boston-solid-oak-4-drawer-chest |
| https://www.oakfurnitureking.co.uk/catalog/product/view/id/45/s/boston-solid-oak-4-drawer-chest/category/50/ |
| https://www.oakfurnitureking.co.uk/catalog/product/view/id/45/s/boston-solid-oak-4-drawer-chest/category/22/ |
| https://www.oakfurnitureking.co.uk/catalog/product/view/id/45/s/boston-solid-oak-4-drawer-chest/category/74/ |0 -
Duplicate Content?
Hi All, I have a new client site, a static site with navigation across the top, and down the left side. Two of the menus from the top navigation are replicated in the navigation structure on the left hand side. They have the exact same url structure, they are in fact the same exact page, listed on the site in two areas. My question is - is this a case of duplicate content, or, as they urls are the exact same, will they be seen as a single page? A canonical tag on one would be replicated on the other by the CMS - so do I leave it, or try to get them to re-structure removing one of the links? (I doubt they will do this as its a brand new site they just has developed). Many thanks!
On-Page Optimization | | Webrevolve0 -
Disappearing Rel=Canonical Code
Hi, I've been getting a lot of rel=canonical warnings from seomoz. I went into the original pages and pasted in plain text the following code: link rel="canonical" href="http://www.example.com/blog/my-awesome-blog-post"< (the > are reversed). After a few crawls I couldn't see any effect from posting the code. When I went and checked again, it didn't stay in the wysiwyg editor. It disappeared! We are using Drupal 6. Could someone tell me what code I should be pasting? Thanks!
On-Page Optimization | | OTSEO0 -
Is rel=canonical used only for duplicate content
Can the rel-canonical be used to tell the search engines which page is "preferred" when there are similar pages? For instance, I have an internal page that Google is showing on the first page of the SERPs that I would prefer the home page be ranked for. Both the home and internal page have been optimized for the same keyword. What is interesting is that the internal page has very few backlinks compared to the home page but Google seems to favor it since the keyword is in the URL. I am afraid a 301 will drop us from the first page of the SERPs.
On-Page Optimization | | surveygizmo0 -
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