I have a page
index.php with 3 Bootstrap tabs in it, and for each tab I am generating its content after user clicks on it.
Is this good approach? Is Google going too see all that data when it index the page containing all this tabs? I do not want to pull all data at once because of performance issues.
Here is my sample code, so please tell me if this is a good approach:
I am afraid that search engines will not see second and third tabs contents. Or at least they will not relate them with index.php page. Am I wrong?
No, we (Google) won't see the content behind tabs iff the content under the tab is dynamically generated (i.e. not just hidden).
You can also see what we "see" using Fetch as Google in Search Console (former Webmaster Tools); read more about the feature in our post titled Rendering pages with Fetch as Google.
If you are using JS/AJAX, (I don't really see any, but I can't think of a better alternative) you are going to have a hard time getting Google to index your pages. Google has a good documentation on this that has helped me in the past on projects with similar goals.
Is it really that big of a deal to not load the content until the tab is clicked? Unless you are working with an un-cacheable constantly updating database and massive HTML output that would create a long flash of unstyled content I would say splitting the tabs view code is somewhat trivial.
Maybe this can help:
If your problem is performance, it's maybe because you have strong DB queries or a shared server. If not, please ignore this.
When loading the whole page, put a "fake" HTML code in each tab. Try to build the HTML code shaped as the real code that is loaded when each tab is clicked. Put all of this inside an invisible DIV. Each time the page is loaded, put also some random data (maybe a 16-chars random-generated string). In this way I think Google will spider your data more frequently (this doesn't happen for static content).
©2020 All rights reserved.