Okay to have text in javascript?
-
There are so many conflicting opinions out there, one of which I recently read indicated that if you are putting your keywords in javascript, the new google update would have an issue with this.
If you want to keep a page clean looking and have visitors click to read more text, is the opinion here that this is okay or an issue? The main purpose of adding text in javascript would be to have enough content on the page without making it look cluttered.
Webmaster tools says that when you have hidden text in javascript, the same content should be placed in a no script tag?
Thanks.
-
The client wants to remove existing content to create a cleaner look on the page. I suggested we find a way to keep that content to avoid losing the traffic it generates and turning the page into a low quality page. My thought was to display a portion of the content and have the visitor click to view the rest.
-
What I've found is that it is okay to have text in JavaScript and Google/Bing will probably index that content if the JavaScript is not too complex. I've seen it not index more intense JavaScript or scripts that require user interaction. You can put alternative text in noscript tags and that seems to work okay.
Typically though, I recommend putting the super important optimized text in regular old HTML instead of JavaScript. That way you are 100% certain that Google/Bing can crawl and index that content. Plus, it is typically easier to manage content in HTML.
However, what you said about the clutter makes it sound like your JavaScript is adding effects to text already in the HTML. Is that the case? For example, you have a div on your page that contains some text. By default, it has the style attribute "display:none;". When a user clicks or takes some action, you change that display attribute to shows previously hidden text. Is that what you are doing?
If that is what you are doing, or something like that, then you have text in HTML not JavaScript. One easy way to check this is to disable CSS and JavaScript then load your page. You want to make sure you can see the content you want Google/Bing to index.
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
-
H1 text and Header Image Overlap?
I have images with text at the top of every page on my site. But no H1 or H tags at all. I would like the text on the image to be my H1 text. But I don't want to be repetitive. What should I do?
On-Page Optimization | | Calligraphy0 -
Can Javascript Links Be Used to Reduce Links per Page?
We are trying to reduce the number of links per page, so for the low-value footer links we are considering coding them as javascript links. We realize Google can read java, but the goal is to reduce level of importance assigned to those internal links. Would this be a valid approach? So the question is would converting low-value footer links to js like below help reduce the number of links per page in google's eyes even though we're reasonably sure they can read javascript. <a <span="" class="html-tag">href</a><a <span="" class="html-tag">="</a><a class="html-attribute-value html-external-link" target="_blank">javascript:void(0);</a>" data-footer-link="/about/about">About Us
On-Page Optimization | | Jay-T0 -
OMG! does Google really consider text-decoration:none as a hidden link?
So I was reading this article today https://www.mattcutts.com/blog/hidden-links/ Can setting a link to the same color as regular text and applying text-decoration:none really be considered a 'hidden link'?
On-Page Optimization | | cbielich0 -
Replacing text with images
Hello, My client is a "cheap calls" site which is offering calls to around 300 countries in the world. The pages for each country are almost the same, as they are mostly terms and conditions of making a call and explanation of the process how to do it. The copy is quite long (more than 850 words) and the country name is repeated about 26 times in the text. The country name and the phone number is the main difference between the pages, which makes them almost the same. I have recommended to add testimonials to each country and towns within the country, but I am afraid it will not dilute the similarity between the pages enough for Google to stop seeing them as duplicated. Also the client do not exactly rush to publish the testimonials for every country. The rankings are not too bad and all seems fine, but in the long term I know we need to do something. I am not sure if the client would agree to shorten up the copy, as they believe in old style seo with keyword stuffing and bolded keywords but I would like to overcome that problem with exchanging the most of the copy with an image. I would write a new copy for each page making it unique (around 2-3 paragraphs) and the rest would be an image stating exactly the same thing as the copy now to provide the same amount of info to the user. Theoretically it should help to resolve this problem, but would like to check if anyone has done something like that and if it worked/may work. Are they any other implications?
On-Page Optimization | | ThinkingJuice0 -
Is Googlebot seeing text in my 'Read More' bar and could they even be penalising me for it?
Hi guys. Our web developers have put a read more bar that contains the on page SEO text for our webpage. By default, the read more bar is not expanded and you cannot see the text within. If you click 'Read More', the box expands and the text is shown on the page. I was wondering if googlebot is seeing this text at all - it's really important that it does because it contains all the on-page SEO text. I also wondered if this type of approach is still considered 'white hat'? If it's not, could google be penalising us for it? Thanks,
On-Page Optimization | | CarlDarby0 -
Why would meta description text get added to the meta HTTP-EQUIV tag?
For one of my clients, the people coding the site added the meta description content to the HTTP-EQUIV tag as part of the "name" attribute. Curious if anyone has seen this practice before?! I notified them that the description meta tag was not coded properly -- the search engines do not interpret the "name" attribute and the text that is in it. Anyway, It looks like: **<meta http-equiv="<a class="attribute-value">Content-Type</a>" content="<a class="attribute-value">text/html; charset=utf-8</a>" name="... <a class="attribute-value">and services. ... .</a>" />**
On-Page Optimization | | alankoen1230 -
Should I use bold for the first few sentences of a text?
I would like to know if anyone knew if the relevance of a page changes if I bold the first few sentences. Our journalist wants to bold the first few sentences in every article to make it easier to read, how does that affect SEO?
On-Page Optimization | | mtueckcr0 -
Anchor text, same page, different kewords to same URLs
Could someone please tell how Google treats the use of anchor text from a single page when using different keywords that all point to the same URL. So for instance I am doing a blog post and use the following anchor text which all point to the same URL: Cool Widget >> www.domain.com/widget Awesome Widget >> www.domain.com/widget Mighty Widget >> www.domain.com/widget I have read that Google will only take noticeof the first one? Thanks
On-Page Optimization | | blagger0