Second day of reading about Google SEO...still confused about this part...what content am I supposed to deliver to their crawler through PHP?
I have a blog site, the index page has a limit of 5 articles which are a preview to the full article (I think this is more or less standard). The pagination right now is /index.php?pg=1
, /index.php?pg2
...although I'm about to change it to a hash parameter /index.php#pg=1
.
Each one of the articles has their own full page with comments, and each article content coming from MySQL has its own full HTML inside a column (coming from CMS with a WYSIWYG editor). I know I can play around with Google's "Fetch as Google" option...but the original question being...what to serve from my database when the request comes in as:
if(isset($_GET['_escaped_fragment_'])){
//how to structure the data for the crawler?
}
Do I structure it to look the same as inside the content
div on the original page? Do I use new DOMDocument()
? The original query is:
$stmt = $conn->query("SELECT id, title, itemText, category FROM blog UNION SELECT id, title, itemText, category FROM items ORDER BY id desc LIMIT $lim, $limit");
I understand this might be better suited for webmasters stackexchange question but it deals more with the PHP side of it so please bear with me and help me understand.