Hi to everyone and thanks in advance for your time reading this question.

Im kinda new on this SEO stuff and there is something that I can't figure out how it works despite all the readings that I did.

I've developed a new website which allows users to add recommendations for every kind of bussiness, places, professionals, etc, so other people can see if travel to X place is worth it for example.

From what I've read so far (and from what I've understood, which are actually two different things haha) its important to make user and search engines friendly URLs and have proper keywords, title and h1 tags.

(I've read this post SEO for pages that load from database and a few more)

That's not a problem because I can do that on server-side code, but what I actually don't understand is how Google shows pages that collect info from databases on his search results.

Lets put an example just to detail this a little bit more.

If we go to Google and search for "abercruz paginas amarillas" google show us a link that send us to a page from "paginasamarillas.com" which has all the details about that store.

Instead if we go to Google and type, "abercruz yousug" (which is my page) nothing shows up. I know that it could take a few days to Google to index my page but I don't understand HOW could Google "search" into my database (or page, or whatever) to end with the correct URL which shows the details of that Commerce

If someone could explain me that or help me a little bit understanding how to rank content that is generated from a database I will very grateful.

Thanks again!


I believe what you are asking is how will search engines find your content without it all being linked to from your home page, because your site is mainly search driven. The obvious and best answer would be an XML sitemap. Generate a sitemap from your database on regular intervals to keep Google up to date about all of your content.

Some more info about sitemaps: https://support.google.com/webmasters/answer/156184

I have a large site that I generate a sitemap for automatically (well actually several sitemaps in batches of 40k URLs at a time). Here is a basic version of a PHP sitemap generator I wrote:


/* Do some stuff */
/* Connect to mysql etc */

/* create a dom document with encoding utf8 */
    $domtree = new DOMDocument('1.0', 'UTF-8');

/* create the root element of the xml tree */
    $xmlRoot = $domtree->createElement("urlset");
    $xmlRoot -> appendChild(new DomAttr('xmlns', 'http://www.sitemaps.org/schemas/sitemap/0.9'));
    $xmlRoot -> appendChild(new DomAttr('xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance'));
    $xmlRoot -> appendChild(new DomAttr('xsi:schemaLocation', 'http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd'));

/* append it to the document created */
    $xmlRoot = $domtree->appendChild($xmlRoot);

/* Loop through our database results and create URL entries for each page */
    while ($row = mysql_fetch_array($result)){
        $currentTrack = $domtree->createElement("url");
        $currentTrack = $xmlRoot->appendChild($currentTrack);

/* save the xml sitemap */
    $domtree->formatOutput = true;
    $domtree->preserveWhitespace = false;

Obviously you would need to customize this to work with your database/content/url structures but hopefully this will help you get started.

  • Hey Josh, thank you very much for your answer. I was thinking indeed to create a script to generate a sitemap with all the content of the database and then use the URLRewriter module that I have in IIS to redirect from friendly URL to the internal ones. The question then is, if I use that sitemap should I submit it to all the search engines? Or the spiders will just read the sitemap despite it's submitted or not? – Daniel Jul 7 '14 at 20:51
  • @Daniel Most search engines will look for domain.com/sitemap.xml automatically, however I would still link to it in your robots.txt and also submit it to Google Webmaster Tools and Bing Webmaster Tools – Josh Mountain Jul 7 '14 at 20:55
  • Great then. Thank you again for your time and your reply. It helps me a lot. – Daniel Jul 7 '14 at 21:06

Not the answer you're looking for? Browse other questions tagged or ask your own question.