Reputation: 1018
I need to create a sitemap for my website to submit to search engines such as google. The site is dynamic so the sitemap links would be generated every time users add new content. The site is php based. I don't know where to start. Any help or resources out there?
Upvotes: 1
Views: 254
Reputation: 197564
You start with creating a list of links that are all leading to a page on your site. But only use one link for one page (not multiple links for the same page).
Next to the link you can put a lot in there, look into the XML sitemap specification what is all possible.
Upvotes: 1
Reputation: 4592
You could create a cronjob to build your sitemap at the end of each day. The cronjob script can access your pages or post table and check maybe for site_map status.
`site_map` tinyint(1) unsigned not null default '0'
Grab all the pages/posts where site_map === 0 then append those links to your sitemap.xml file. Once built set site_map to 1 and ping the search engines.
it is adviced to do this at the end of each working day and not each time a new post/page is created , anytime after 00:00:00 should be fine.
Edit: you might also want to check for canonical links, ie: duplicate content
Upvotes: 1