Google Indexing of table pages

Google Indexing of table pages

frobinrobinfrobinrobin Posts: 3Questions: 1Answers: 0

OK, so I've searched and can see that questions around "google indexing datatables" has been bought up before:

https://datatables.net/forums/discussion/20117/google-snippets-for-data-in-datatable
https://www.datatables.net/forums/discussion/13801/bserverside-and-seo

We've recently had a company do some auditing of our site and the SEO, we've made some changes and all is good.

Up until October 2015, we had used the method described here:
https://developers.google.com/webmasters/ajax-crawling/docs/learn-more#an-agreement-between-crawler-and-server

That's now been deprecated and Google will render your page with datatables fully rendered, ajax data included.. nice!

Now, herein lies the problem - apparently, Google does not click on links which are just hashes "#" as it still considers this client-side functionality - which means it will not follow the pagination links.
However we can tell Google to follow pager links simply by adding an exclamation mark after the links which should be followed.

Therefore I'd like to know whether it would be possible to update the pager links to be "#!" instead of just "#".

I know there are custom pagination plugins and I could probably create one - however it's probably best to fix the "issue" here - at source, giving everyone the lovely benefits of Google paginated indexing!

Answers

  • allanallan Posts: 63,075Questions: 1Answers: 10,384 Site admin

    Thanks for your post and the research on this topic!

    While I look into how this can be integrated into DataTables core, what you can use right now is the drawCallback option to add the required hash:

    drawCallback: function () {
      $( 'a.paginate_button', this.api().table().container() ).attr('href', '#!');
    }
    

    Depending on what styling library you are using you may need to update the class that is checked for.

    I hesitate to include this in DataTables immediately as it will add the #! to the browser's history trial, so I need to look into the impact of that. But if that can be made to work well, then that would be fantastic!

    Allan

  • frobinrobinfrobinrobin Posts: 3Questions: 1Answers: 0

    Thanks Allan, such a simple solution!

    For others, my CSS selector for full_numbers pagination is:
    'li.paginate_button a'

    I'll get it checked by the SEO guys and report back.

    • Rob
  • JnoJno Posts: 1Questions: 0Answers: 0

    Hi Rob, do you have any feedback to share about the hashbang solution working for your SEO guys?

    Ty Jno

This discussion has been closed.