For Duz or another online marketing expert

What is the best way to hide javascript and other tracking code from search engine spiders?
I'm performing some SEO changes with our website and feel this would help improve the site in search engines.
The code is unreadable by spiders, but it slows down the spidering process and contributes to low text:code ratios.
I'm looking for the best way to improve text:code ratios and speed up the spidering process...

Any suggestions?
~trail
LVL 20
trailblazzyr55Asked:
Who is Participating?
 
humeniukCommented:
A search engine spider works something like an unsophisticated text browser.  Most javascript is inherently ignored by spiders altogether.  There are several simulators online, for example: www.webmaster-toolkit.com/search-engine-simulator.shtml.  

The webmaster toolkit site has several other handy tools.
0
 
trailblazzyr55Author Commented:
I realize that puting JS in an external file will help, most all the code is, but is there anything more I can do?
0
 
humeniukCommented:
Putting all your javascript, etc. into external files is a good start.

Another important factor is to use web dev methods that are effective, efficient, and standards compliant.  For example, using a css-based layout is far more efficient than a table-based design, which will inherently be plagued by bloated code that will be very difficult to validate.

The key is to simplify your code to make it easier for the spiders to digest and get through it.  For example, which of these is easier to understand . . .

<strong><font color="#CCCCCC" size="24px">Your Page Header Here</font></strong>

     or

<h1>Your Page Header Here</h1>   ?

In the latter case, the attributes are defined in an external CSS file.  The benefit is not just that there is less code and less clutter, but also the fact that the contents of  a <h1> header soon (or immediately) after your <body> tag will be heavily weighted by the search engines.  If it contains one or more of your intended keywords, it will be very potent.

These elements have to be used together.  In a typical table-based design with a big masthead, lots of javascript or flash menus (etc.), your content, including your header will be inherently forced down your page - you will frequently see such pages where the real content doesn't begin until the second half of the html page.  You want your keywords to appear 'early and often' on the page.  This means on the code page, not on the web page as it appears in the browser.  This can more easily be accomplished with a good css-based layout.
0
Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

 
humeniukCommented:
BTW - you may find this handy: www.stargeek.com/code_to_text.php.
0
 
trailblazzyr55Author Commented:
humeniuk,

stargeek.com seems to be a very useful site! Thanks for the suggestion.

Does anybody know of a tool that will simulate a search engine and how it views primarely javascript, or what it sees when it indexes your page? I'm editing my scripts and creating statements to hide the javascript from the search engine, but I need a tool to see if it's working. Anyone have any ideas?

thanks,
~trail
0
 
trailblazzyr55Author Commented:
humeniuk,

Thanks for the help, I found a way through CF to hide javascript completely from search engine spiders, these two sites..

1)www.stargeek.com/code_to_text.php
2)www.webmaster-toolkit.com/search-engine-simulator.shtml

were also very helpful, thanks for your input :o)

~trail
0
 
humeniukCommented:
Glad to be able to help, trailblazzyr.  Thanks for the A.

The CF solution sounds interesting.  You may want to consider posting some info about it here (if possible) as it may be very useful to future readers.
0
 
trailblazzyr55Author Commented:
yeah not a bad idea,

what I found was better being I was using coldfusion was to hide the javascript when engine spiders index the page. But when the page is visited the scripts are all available. I have page that detects browsers and puts them in a list named say, MyBrowserList. Then I would do something like this..

<cfif MyBrowserList IS "yes"><cfelse> ---the code to hide---</cfif>

basically checks from the browser list if it is being spidered, if so hides the code, but has no affect when viewing the pages.

Thanks for your ideas and comments,
humeniuk
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.