Mobile app version of vmapp.org
Login or Join
Bryan171

: Make Google index over 90,000 user profiles I have a large amount of user profiles hosted in this schema https://example.com/stats.php?player=name (It's not the prettiest URL, but .htaccess dramatically

@Bryan171

Posted in: #Apache #Apache2 #Mysql #Php #Seo

I have a large amount of user profiles hosted in this schema example.com/stats.php?player=name (It's not the prettiest URL, but .htaccess dramatically slows down my site and I don't understand apache2.conf). Anyhow, how can I get Google to index all of these pages dynamically without having to enter all 90,000 accounts into sitemap.xml?

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Bryan171

2 Comments

Sorted by latest first Latest Oldest Best

 

@BetL925

A sitemap does not usually help get pages indexed. See The Sitemap Paradox.

To get pages indexed:


You need to link to each page from some other page or preferably multiple other pages.
Include enough unique content on each profile that Google doesn't view the pages as duplicate.
Provide a good landing page experience for anybody coming to the page from Google search. If Google does index the page but then find that nobody clicks to it, or everybod that clicks returns back to click on another result, it will drop in rankings or fall out of the index pretty quickly.


In general, user profile pages are generally not great candidate pages for inclusion in Google's search index. They usually don't have a lot of content, nor are they good landing pages.

10% popularity Vote Up Vote Down


 

@Pope3001725

Sitemaps can be dynamic just like web pages. Just have a PHP script grab those names from the database and make a loop to echo out the XML for each one. Also, make sure you output the proper content type for your XML. That's it.

The code below is a basic script for generating a dynamic XML sitemap. Please not this is only an example intended to point you, or anyone looking to create a dynamic sitemap, in the right direction. There really should be better error checking and handling here.

<?php
$link = mysqli_connect("localhost", "my_user", "my_password", "world");
$query = "SELECT name FROM users";
if ($result = mysqli_query($link, $query)) {
echo header("Content-type: text/xml");
?>
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<?php
$date = date('Y-m-d');
while ($row = mysqli_fetch_assoc($result)) {
?>
<url>
<loc>https://domain.com/stats.php?player=<?php echo $row['name']; ?></loc>
<lastmod><?php echo $date; ?></lastmod>
<changefreq>monthly</changefreq>
<priority>0.8</priority>
</url>
<?php
}
mysqli_free_result($result);
?>
</urlset>
<?php
}
mysqli_close($link);
?>


Keep in mind that a single sitemap may have only 50,000 records in it so this script has its limits. But you should be able to modify it to handle multiple sitemaps which allows you to grow beyond the 50,000 limit.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme