Forum Moderators: coopster

Message Too Old, No Replies

PHP/MySQL text and SEO

Does PHP code get picked up by search engines?

         

ladams02

4:24 am on Aug 16, 2006 (gmt 0)

10+ Year Member



I'm creating a news script to store news articles in a MySQL database and using PHP to access this DB. I was wondering since PHP processes before the page is loaded will it display the text from the DB and allow this text to be picked up by search engines?

Thanks!

alexorig

5:00 am on Aug 16, 2006 (gmt 0)

10+ Year Member



Yeppo, PHP is a hypertext preprocessor so the database will be read and converted to HTML (or whatever) before the search engine ever sees it. The search engines never see your PHP unless your script crashes and throws an error that exposes something to do with your code.

A good practice if you are thinking your site will get a lot of traffic is to make the file that is served to the search engine static and only rewrite that file using a php script when a new article is uploaded. This can result in faster page loads, a more stable database and the ability for the site to survive being slashdotted/dugg.

A good point to note though is if you are using news articles culled from some obvious source (eg bbc news) and aren't making some sort of significant change to it or mash up with other information it may well be seen as duplicate content and penalized. Of course I could have just misunderstood what you mean by news, if so sorry!

ladams02

5:07 am on Aug 16, 2006 (gmt 0)

10+ Year Member



Sorry, by news script I meant a site news page for my personal homepage where I will post updates I have made and so forth.

Basically, I have an index.html (w/ .htaccess allowing PHP code in .html extensions) and my PHP script loading the top two entries from a site_news table. The rest of the site_news ntable is accessible through news-archive.html. Is this what you meant by only rewriting when a news article is posted?

What is it when a site is slashdotted/dugg? What causes this?

Thanks!

alexorig

5:18 am on Aug 16, 2006 (gmt 0)

10+ Year Member



When a site is slashdotted it is posted to the front of slashdot and when it is dugg it gets to the front of digg. It causes a huge amount of traffic which is really good but a fair few sites end up crashing when it happens.

Actually I was suggesting whenever you upload a new news item to that table the index.html (or .php without .htaccess :) ) page gets written statically. No need to pull the news from the table every time the page loads if you know it hasn't changed. I don't do this with all my sites but the ones where I am that get a few thousand hits an hour show significant performance increases.

Otherwise on SEO hope I answered your question the search engines shouldn't see your php.

ladams02

5:26 am on Aug 16, 2006 (gmt 0)

10+ Year Member



Yes thanks for your help with this. I am interested in reading more about updating the index page with the new entries. I'll have to look into this further in the morning. Thanks again for the help!