How can I hide a specific <div> from Google?
Is there any other solution than using javascript to insert this element?
I read about <!-- googleoff: index--> here, but I'm not sure it does what I want.
The problem is that the div I'm trying to hide can be seen as duplicate content by Google, and even if it hides it from the search results, I think it still penalizes you...
You can put the data in separate file, load it using iframe and block google spider from this file using robots.txt.
Apart from dynamically inserting the text into a page in a way that will only occur on a browser (as you mention, javascript would be the weapon of choice), not really.
You could hide the whole page using the correct robots.txt entry, but that doesn't seem to be what you are trying to achieve. This could work if the page contains only the text you want to hide and you insert it as an IFrame.
I don't know the specifics of what you are trying to hide, so this may or may not be ideal. However, one option that might work for some scenarios would be to convert the content you are trying to hide from the search engines to an image.
Related
I need to embed both pdf-files and images in my html-page, however, due to the fact that my html contains a form and the user has to be able to decide whether he would like to upload a pdf-file or an image, I need a flexible solution regarding how to embed either a pdf-file or an image with the same code.
I read that I could possibly use the <object/> tag, however, I also read that that's not a very "elegant" and possibly slow solution.
I also considered to use <embed/> which, as of right now, is the best solution I could come up with. Unfortunately I couldn't find out about if it's a very conventional solution or not.
I can't seem to find very much resources regarding this topic online, hence why I'm asking here. Are there any other/better ways to embed a pdf- or image-file in an html page?
Edit: I want top display the pdf kind of like a file. Also, I don't want the user to be able to resize the pdf in the viewer
I'm sure this is better suited to a comment, however I'm new and am working on unlocking that feature.
...however,
due to the fact that my html contains a form and the user has to be
able to decide whether he would like to upload a pdf-file or an image...
What are you using for the form (query language & database management)?
(PHP, Django, MySQL, MongoDB, etc)
Are there any other/better ways to embed a
pdf- or image-file in an html page?
I would recommend using embed or iframes. You are correct in thinking that the object tag is not an elegant solution, since you are dealing with images.
Edit: I want top display the pdf kind of like a file. Also, I don't
want the user to be able to resize the pdf in the viewer
Easy to do with iframes. There's a lot of hate when it comes to iframes. As you seem to plan on using it as a tool to display a file within a page, then I believe using an iframe here is just fine.
Check out this link on iframes. (will also tell you how to keep the user from resizing it)
I'm not sure I've asked that question correctly, but hear me out...
In my main navigation I am calling a number of my links via fancybox.ajax, which then displays a separate page (ie. clicking on a link entitled 'INFO' opens info.php within Fancybox).
This is working, but I also see examples where people use a hidden div.
This question is helpful, explains things from an SEO standpoint, and has caused me to rethink my structure. The question is why would I want to contain my data in a separate page rather than a hidden div, and what benefits does it bring me? I'll note that I am currently using separate pages because I believed that was a good practice, but after reading that question I have been turned.
EDIT : I understand why I would use a separate page without a modal obviously...but I am specifically asking about not using hidden divs with a modal box
If you are calling those external pages via link, then Google follows the links regardless whether they are opened in a modal box or not. If you have javascript disabled those pages still will open. So
<a class="fancybox" href="info.php" rel="help">INFO</a>
... is a perfect valid structure from the SEO point of view. How the information will be shown to the visitor, in the same window, in a new tab or in a modal window is a matter of presentation.
Curiously, you could have a hidden <div> and open the contents of such in a modal window, but as mentioned by #zachary, having hidden content may affect the performance of your page load.
NOTICE that in this case we are talking about displaying "linked" content in a modal box, which is different than pulling the content dynamically via any ajax method (jQuery .load() or $.ajax() for instance) ... that definitively has effects from the SEO point of view because Google won't see the contents and the contents actually won't show up at all if the visitor has javascript disabled.
The Case for AJAX Modals
Pros
Easier to manage and organize in some setups
Markup is clean
Great for when working with a lot of data that takes time to load. Lazy loading in this way makes the app feel responsive.
Cons
Google does not crawl content (can be a pro in some cases)
Slower to render compared to hidden div
In most cases you want the hidden div. And if not, a function to render the content dynamically.
I've got a large collection of pages on my site, each with unique content, but also with often redundant sidebar surrounding that content. I'm worried that this sidebar content is dragging down my site in Google, Bind, etc by diluting the results. What can I do to effectively hide this content from web spiders, but not my users?
Thanks!
It's just my gesture, but Google is smart enough to find out where is a navigation element and where are the content.
However, there might be various reasons why your website loosing positions. I would start from reading this help tipic, also keep in mind that Google search results are dynamic and once you reached first position does not guaranty that you would stay there, someone might just providing more unique content that match current subject and he would be pushed up.
If you want to make sure that search engines are aware about your document structure, and point them out what is what use microdata markup.
For example you can wrap a navigation in following format:
<ul itemscope itemtype="http://schema.org/SiteNavigationElement">
<li>
Home
</li>
...
</ul>
There after, your navigation items would appear in:
Google Webmaster Tools > Optimization > Structured Data
Also, by hiding your content with AJAX/JavaScript is more likely to harm your visitors who have disabled JavaScript or due to possible error in your library and in fact Google can understand and index asynchronous requests.
One thing you can do is not include it in the page mark-up and to load it in after page load using AJAX.
The sidebar won't affect your SEO efforts as it isn't duplicate content. Site navigation is expected to be on every page (and it is obviously very common). Duplicate content, from a search engine point of view, is when the page's primary content is identical or nearly identical, to another page's content.
A better solution would be to move your content to the top of the page and your navigation code down the bottom. Reposition stuff with CSS.
Otherwise, Ajax or put text into images.
I am using AJAX to update content in my website. My index page has only a menu bar and a '#content' div where the dynamic HTML is appended.
The server I am using has no PHP or database features so no JSON is used.
I am downloading HTML pages straight from the server and populating the index. I am unsure what the best way to style the dynamic pages with CSS. Should I link the style sheets to the index page or to each of the content page(s)?
Also is there a need to put tags in the content pages?
Depends on how much CSS you have.
But most likely best solution is to just combine all CSS into one file and then link to it from the index page, the benefit of this is that the browser can cache it, which means it keeps a copy and doesn't have to download it multiple times.
As far as tags in the content page goes, if you need them use them, if you don't need them don't use them.
What we plan to do is to display a particular page from another site on our webpage (not really a whole page but it's more like a box within a page with job listings on it). However, I heard iFrame is no longer advisable to use.
Is it still okay in this instance (only 1 page and 1 iFrame)? Or are there other alternatives?
#Breezer is right in the fact that you want to use iframes as little as possible for as little of your content as possible(for SEO purposes and the fact you aren't hosting the content, so it could go down at anytime). Aside from this, I doubt the page you are trying to display is being rendered in a way that you want to display on your site anyways. Being a third party site you can use something like curl (server side) to screen scrape the data and parse out what you'd like to display on your site. Or, if you're looking for a client side alternative, you can use YQL to grab that third party information and then render as you may.
Here's a great tutorial on YQL, and doing exactly what you want, from #Nettuts (http://net.tutsplus.com/tutorials/javascript-ajax/quick-tip-cross-domain-ajax-request-with-yql-and-jquery/)
Hope that gives you some options.
well it's fine using iframes to show another external webbpage, what's bad is building an entire website around a iframe because that will be hard to search engines to interrupt what your website is about therefore rank it lower in the search results