Adding href parameter for the pagination links
Adding href parameter for the pagination links
Link to test case: https://www.silabs.com/support/resources.ct-data-sheets.page=2
Description of problem: We are using DataTable with pagination as given in the URL above. During our Google SEO analysis we found the pagination links are missing href pointing to a page and google cant crawl the pages going into the pagination links. So the google search is not indexing/serving the pages/documents in their search results from those pagination links.
Could anyone please advice on how to add href to the pagination links since its auto generated by the plugin instead of like
<a class="paginate_button " aria-controls="DataTables_Table_0" data-dt-idx="1" tabindex="0">1</a>. Any help is appreciated. Thanks
Answers
I just looked at the link and the
href
is present - has this been resolved or am I missing something?Colin
Hi Colin,
I am talking about Pagination anchor tags. It doesn't have href in it which is causing the google to ignore it while indexing.
At this time you can't. We are going to change them to be buttons in future rather than link tags.
Allan
I actually added the href through the drawCallback method like this
Nice workaround. Thanks for sharing it.
Allan
Anyway to do this in DataTables v2? In this version no a href link, divs insted
No it uses
button
for the pagination buttons, which is semantically correct.Why would you want to add an
href
attribute to the buttons?Allan
Yes, button, sorry.
I need a[href] to save page filter/pagination history.
For ex: switch to page 8, reload page and page 8 loaded again automatically.
You can use
stateSave
for this.Kevin