Yii 2.0: yii2-seotools

Component and module to manage unique SEO title, description, keywords and unique text associated with a page

Tool to manage particular SEO Metas and text for especial pages

If you need set unique seo title, description associated with a page this is your extension, you can also add a html text using a wysiwis tool to add bold and links and improve your SEO in page with a unique content.

Set this fields using a module to manage all this functionality.

Use internally a md5 hash to made a unique id with (Host + Path) to identify pages and yii cache system to improve speed



The preferred way to install this extension is through composer.

Either run

composer.phar require --prefer-dist jpunanua/yii2-seotools "*"

or add

"jpunanua/yii2-seotools": "*"

to the require section of your composer.json file.


Run the following command in Terminal for database migration:


yii migrate/up --migrationPath=@vendor/jpunanua/yii2-seotools/migrations


yii.bat migrate/up --migrationPath=@vendor/jpunanua/yii2-seotools/migrations


A simple exmple of turning on seotool component.

'components' => [
        'seotools' => [
            'class' => 'jpunanua\seotools\Component',

Turning on the seotools Module:

Simple example:

'modules' => [
        'seotools' => [
            'class' => 'jpunanua\seotools\Module',
            'roles' => ['@'], // For setting access levels to the seotools interface.


Once the extension is installed, simply use it in your code by :

// @param bool $setCanonical true, try to create a canonical url and og url, action needs to have params
 // @param bool $checkDb try to get from DB params, true: try to get info from DB if it doesn't find save a new field
 // associated to current host + '/' + path, false: it just set the params give in the call. The db params has priority
 // over the call function params. It does a merge
$setCanonical = false;
$checkDb = true;
Yii::$app->seotools->setMeta(['title' => \Yii::t('title','A good title for this page')], $setCanonical, $checkDb);


URLs for the seotools manage module:


Total 4 comments

#19294 report it
rahul23 at 2015/05/13 02:27am
my code is set up

i have been set up all functionality of this plugin create meta base update delete all are working good in my backend but how to use these meta tags title,keyword and all meta tags in my frontend particular pages.

#19290 report it
rahul23 at 2015/05/12 09:38am
yes i run the migrate command can you tell m what is the table name

i have been run this command my module is create in vendor folder only table is not show in to database i am using prettyurl so how to use this urls /seotools/manage /seotools/manage/create

when i run this command second time then show no new migration is found.your code is up to date

#19289 report it
jpunanua at 2015/05/12 09:29am
Do you run the migrate command?


Run the following command in Terminal for database migration:


yii migrate/up --migrationPath=@vendor/jpunanua/yii2-seotools/migrations


yii.bat migrate/up --migrationPath=@vendor/jpunanua/yii2-seotools/migrations

#19288 report it
rahul23 at 2015/05/12 09:08am
how to use it

I have sucessfully install this extention code add into component and module of my config/main.php.

first things i do not have any seotools table in my database and i do not have i idea how to use this extention.

how to show in menu there is no any demo of this extention.

no any search available for this particular topic.

Leave a comment

Please to leave your comment.

Create extension
  • Yii Version: 2.0
  • License: MIT License
  • Developed by: jpunanua
  • Category: Others
  • Votes: No votes yet
  • Downloaded: 198 times
  • Created on: Apr 9, 2015
  • Last updated: Apr 9, 2015
  • Tags: seo