Is it safe to use php include to include aspects which are vital to the semantic meaning of web pages, for things like search engines.
For instance can you have the <h1></h1> headers for your pages all siphoned off to an include? Will google spiders, just as an example, be actually able to see these headers? Is there a type of … passive parsing… if you will, which won’t see html that is dependent upon the execution of scripting?
Or is such exclusion exclusive to client side scripting such as javascript?
Google should NEVER see the raw PHP code, because that’d mean your server is misconfigured. The server-side language/processes you’re using to build the web page are irrelevant to the end-user, all they should EVER see is html.
Since all a spider sees is that html, it doesn’t matter if you’re serving it from a plain old .html file, a .php file, a .whatever_extension_you_want file, etc… as long as it LOOKS like a web page when it arrives on the client.
e.g. you could go to an ludicrous extreme and have every single CHARACTER of a web page done with nothing but single char includes,e.g.
less_than.txt:
h.txt:
t.txt:
m.txt:
l.txt:
greater_than.txt
index.php:
Hideously ugly, ludicrously inefficient, but here’s what the user will see in their browser’s “view source”: