Question

I am going to dynamically include the <head> part of my code so that I can change multiple pages from one file.

my 'include.php' will look something like:

<?php echo '<meta name="description" content="page description"><meta name="keywords" content="keyword1, keyword2, keyword3">'; ?>

Which is faster:

  • <?php include 'include.php'; ?>
  • <!-- #include file="include.php" -->

Also will both be readable by a search engine crawler?

Thank you :)

Was it helpful?

Solution

Search engines will read the content returned by the web server, whether generated by PHP code or SSI include.

As for your question about which is faster, it depends, and you shouldn't worry about it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top