/    Sign up×
Community /Pin to ProfileBookmark

The way I have my page set up, none of the HTML even gets output unless the information is successfully pulled out of the database (all of the PHP code is above the doctype declaration). However, as there’s always going to be something in my database, I don’t see this as a problem.

Is that method going to confuse search engines?

to post a comment
SEO

13 Comments(s)

Copy linkTweet thisAlerts:
@chazzyJan 18.2009 — do you have robots.txt? sitemap.xml ?
Copy linkTweet thisAlerts:
@CharlesJan 18.2009 — Search engines don't care or know what's going on server side--unless you tell them. It doesn't matter how you are generating the pages all that matters is the page, its headers and associated things like the aforementioned robots.txt and sitemap.xml files. However, it is an immutable principal of engineering that everything always goes wrong somehow. Give your routine a default something or another for when the data base does come up empty.
Copy linkTweet thisAlerts:
@Joseph_WitchardauthorJan 18.2009 — I don't know what a robots.txt file is or does. And I haven't really gotten my hands dirty with XML yet. Is designing a site map easy enough to do without having already studied XML thoroughly?
Copy linkTweet thisAlerts:
@CharlesJan 18.2009 — See http://www.robotstxt.org/ & http://www.sitemaps.org/ . If you know HTML you can figure out XML. If you know XHTML then you already know XML...but far fewer know XHTML than think that they do,
Copy linkTweet thisAlerts:
@Joseph_WitchardauthorJan 18.2009 — Thanks to whoever moved this thread?

[CODE]<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">[/CODE]

What exactly is that? I read about it on the link you gave me, but I still didn't understand.
Copy linkTweet thisAlerts:
@CharlesJan 18.2009 — It's a start tag for the element "urlset" having the attribute "xmlns" with the value of "http://www.sitemaps.org/schemas/sitemap/0.9". That particular attribute defines the namespace. The point of XML is to allow the mixing and expanding of mark up languages. That declaration makes that element really an "http://www.sitemaps.org/schemas/sitemap/0.9:urlset". That way you can add other elements with your own namespace that might make your file more useful to you or somebody but that will be ignored by the search engines.
Copy linkTweet thisAlerts:
@Joseph_WitchardauthorJan 18.2009 — It's a start tag for the element "urlset" having the attribute "xmlns" with the value of "http://www.sitemaps.org/schemas/sitemap/0.9". That particular attribute defines the namespace. The point of XML is to allow the mixing and expanding of mark up languages. That declaration makes that element really an "http://www.sitemaps.org/schemas/sitemap/0.9:urlset". That way you can add other elements with your own namespace that might make your file more useful to you or somebody but that will be ignored by the search engines.[/QUOTE]

So if my site was called example.com, would I make mine "http://www.example.com/schemas/sitemap/0.9"? Sorry, I'm just really confused.
Copy linkTweet thisAlerts:
@CharlesJan 19.2009 — So if my site was called example.com, would I make mine "http://www.example.com/schemas/sitemap/0.9"? Sorry, I'm just really confused.[/QUOTE]That would change the [font=monospace]http://www.sitemaps.org/schemas/sitemap/0.9:urlset[/font] element into [font=monospace]http://www.example.com/schemas/sitemap/0.9:urlset[/font] which search engines will not recognize and will ignore. Leave that namespace declaration alone.

Lets say you get your sitemap.xml page done. You've done a lot of work and it might just be something useful to humans searching for things on your site. There is a way to make XML files display nice on a browser with what are called XSLT stylesheets. So you write a stylesheet that gets the sitemap looking like the rest of your site and everything is good until you realize that you would like to add some more information about each file. The Dublin Core metadata comes to mind. See http://www.w3schools.com/rdf/rdf_dublin.asp . Your sitemap might then look like:&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:dc="http://purl.org/dc/elements/1.1/"&gt;
&lt;url&gt;
&lt;loc&gt;http://www.example.com/&lt;/loc&gt;
&lt;lastmod&gt;2005-01-01&lt;/lastmod&gt;
&lt;changefreq&gt;monthly&lt;/changefreq&gt;
&lt;priority&gt;0.8&lt;/priority&gt;
&lt;dc:title&gt;Some Pig&lt;/dc:title&gt;
&lt;/url&gt;
&lt;/urlset&gt;
Your stylesheet can now pick up the title and the search engines just ignore it--or not. The reason you use the Dublin Core and not your own made up namespace is that the Dublin Core is widely known and controlled. Search engines are going to know what dc:title means, but only because they have replaced the "dc" with the url supplied above, and so they [i]might[/i] make use of this information.
Copy linkTweet thisAlerts:
@Joseph_WitchardauthorJan 20.2009 — Okay, so the <urlset> needs to be specified by those standards, right? You don't customize it any for your site, because search engines follow what's in those specific links (sitemaps.org and purl.org)?
Copy linkTweet thisAlerts:
@CharlesJan 20.2009 — Exactly. If in doubt, and even if not, Google has a sitemap validator somewhere in there.
Copy linkTweet thisAlerts:
@Joseph_WitchardauthorJan 25.2009 — Does the XML file need to be included in your other pages, or does it just need to be stored on your server (giving the URL to search engines you're submitting it to, of course)?

Also, my site is already listed on search engines, but I've never had a sitemap; I just gave them the homepage URL. Don't search engines get irritated with your site if it's submitted to them more than once?
Copy linkTweet thisAlerts:
@CharlesJan 25.2009 — Set up an account with Google and then once you sign in one of the links will be for 'Webmaster tools" or something like that. There you will find more intricate instructions and a way to submit your sitemap.
Copy linkTweet thisAlerts:
@Joseph_WitchardauthorJan 26.2009 — Thank you so much?
×

Success!

Help @Joseph_Witchard spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.3,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...