Wednesday , 1 October 2014
Home » PHP Framework » CakePHP » Set Meta Tags (SEO Tags) in CakePHP
Set Meta Tags (SEO Tags) in CakePHP

Set Meta Tags (SEO Tags) in CakePHP

Hello Friends,

In my previous post, i show you the way how to set Page Title Tag in CakePHP. But setting Meta keywords and Meta Description is not the same way as Meta Title. .Also Meta Keyword and Meta Description is important part of Search Engine Optimization. Refer to below syntax to set Meta tags in CakePHP.

<?php 
echo $html->meta('keywords','enter any meta keyword here');
?>
//Output <meta name="keywords" content="enter any meta keyword here"/>
<?php 
echo $html->meta('description','enter any meta description here');
?>
//Output <meta name="description" content="enter any meta description here"/>

If you find any problem in this than let me know by comment.

About Rakshit Patel

I am PHP Freelancer, Rakshit Patel AKA WordPress Freelancer working as PHP Programmer India. I am here to share all my developing knowledge, quick coding techniques, quick solutions to save your time and help you guys for any issue or bug fixing. If you have any PHP, WordPress, Magento related work, please contact me. I am interested for the work.

13 comments

  1. Hi..
    Very nice well managed blog Rakshit. By profession I am SEO executive, so not understood much in this post about CakePHP. But I like that being a developer, you are learning SEO techniques. It will definately help you in future  lot. I am also learning some CMS and PHP now to expend my knowledge.

    Gerat to read your profile however you have not mention the company you are working for. anyways if I can help you anyway I will be glad doing that.
    Keep it up.

  2. Hi..
    Very nice well managed blog Rakshit. By profession I am SEO executive, so not understood much in this post about CakePHP. But I like that being a developer, you are learning SEO techniques. It will definately help you in future  lot. I am also learning some CMS and PHP now to expend my knowledge.

    Gerat to read your profile however you have not mention the company you are working for. anyways if I can help you anyway I will be glad doing that.
    Keep it up.

  3. @Hetal Thanks for Compliment.

  4. @Hetal Thanks for Compliment.

  5. Hi,

    I have big troubles customizing my meta tags. I hope you can help me out. I currently use the following line:

    echo $html->meta(‘description’,$this->getVar(‘metaDescription’));

    But how can I put a default value in case the $this->getVar(‘metaDescription is empty?

    Cheers

  6. I’m not sure the place you are getting your information, but great topic. I must spend some time learning more or figuring out more. Thanks for excellent information I used to be on the lookout for this info for my mission.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>