Help Me/Question How To Add Meta Tag In Php ?


New Member

get_meta_tags — Extracts all meta tag content attributes from a file and returns an array

Brillmindz Technologies Pvt Ltd


White Belt
you have to use yoast SEO, i think this is the best tool to get batter SEO optimization with meta tags


White Belt
Here is the PHP for the variables


$tpTitle="Helping you to improve your web site";

$pgHeading=" - Helping you to improve your web site";

$pgDesc="Helping you to improve your web site";



David Paul

New Member
The major search engines recommend that each page on your site has a unique title and meta description. This can easily be achieved with php if you have data stored somewhere to populate those tags.

In your html template you may have something like:-

<link rel="stylesheet" type="text/css" href="css/style.css">
<title><?php echo $title ?></title>
<meta name="description" content="<?php echo $description ?>">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name=viewport content="width=device-width, initial-scale=1">