Itay Gutman
Itay Gutman

Reputation: 7

seo effect - include file with <html> tag inside

Maybe its a stupied question but i didnt fild any answer for it, If i have file with the html tag head tag&meta.. and I include him in all my web page, its effect the seo of the site?

I have file named "start_html.php" that have this code:

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="description" content="bla bla.">
    <meta name="keywords" content="bla bla">
    <meta name="author" content="bla">
    <title>bla bla</title>
    <!-- CSS: -->
    <link href="style.css" rel="stylesheet" type="text/css" media="screen" />
    <!-- JavaScript -->
    <script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>

I start every page with this line: <?php include('start_html.php'); ?>

When i check for code error on w3c validator its says that i dont have those tags so the page is not coded good.

Upvotes: 0

Views: 978

Answers (3)

sybear
sybear

Reputation: 7784

If you try to send your source file for validation, where you have: <?php include('start_html.php'); ?>

Of course you will get the expected result - no tags, because the source file must be parsed and handled by PHP.

You can give a working link for validation, or copy output in your browser after execution, save the file and send it.

Upvotes: 0

Borniet
Borniet

Reputation: 3546

You should have these meta and title tags on all your pages, so including them from PHP is certainly not a bad idea. However, if the W3 validator tells you these tags aren't there, you should check your output. Perhaps start by 'show source code' in your browser, and see if the tags appear there.

Upvotes: 0

John Conde
John Conde

Reputation: 219884

If the code from that file is not being displayed in your web page then obviously your PHP code is incorrect and that file is not being included. You need to make sure you have error reporting on and displaying all errors as this will catch this for you.

See this StackOverflow question for how to enable error reporting.

Upvotes: 0

Related Questions