Reputation: 7035
I'm building an AJAX based portfolio module using pushState / hash bangs and as I'm ruling out browsers without JavaScript the only thing that concerns me is how limited the HTML custom data attributes are when it comes to SEO.
For example, using the code below:
<ul class="gallery" data-anchor="/photography/example/" data-title="Example"></ul>
Will the data-title be indexed, i.e. will that text content be gathered by Google? Or would I need to include a header tag in or around the list as a descriptive complement? The data-title is meant to be used as a new window title once the user clicks on that particular gallery.
Upvotes: 6
Views: 3829
Reputation: 13360
No, it won't be indexed. The attribute itself will be cached with the page, but Google has no context of what the attribute or the value means, so it is meaningless to search engines.
Upvotes: 8
Reputation: 138110
You should assume that all HTML content can be used to some extent by a search engine.
However, I would say almost invariably that visible content will be weighted much more heavily than invisible content. Even if Google does use data attributes in its weighting algorithm, you should make the content visible to users too
Upvotes: 7