Difference between #155 and #156 of
Yii v2 snippet guide

Revision #156 has been created by rackycz on Oct 14, 2019, 1:58:28 PM with the memo:

seo
« previous (#155) next (#157) »

Changes

Title unchanged

Yii v2 snippet guide

Category unchanged

Tutorials

Yii version unchanged

2.0

Tags unchanged

tutorial,beginner,yii2

Content changed

[...]
'body:html',
],
])
```
... to discover all possible formatters, check all asXXX() functions on [this](https://www.yiiframework.com/doc/api/2.0/yii-i18n-formatter) page:

 
**SEO optimization**
 
---
 
This is not really a YII topic but as my article is some kind of a code-library I will paste it here as well.
 
To test your SEO score you can use special webs. For example [seotesteronline](https://suite.seotesteronline.com/seo-checker), but only once per day.
 
It will show some statistics and recommend enhancements.
 
Important are for example OG meta tags or TWITTER meta tags. They are basicly the same. Read more [here](https://css-tricks.com/essential-meta-tags-social-media/). 
 
 
Basic tags are following and you should place them to <head>:
 
 
```html
 
 
<!DOCTYPE html>
 
<html lang="<?= Yii::$app->language ?>">
 
<head>
 
 
  <meta property="og:site_name" content="European Travel, Inc.">
 
  <meta property="og:title" content="European Travel Destinations">
 
  <meta property="og:description" content="Offering tour packages for individuals or groups.">
 
  <meta property="og:image" content="http://euro-travel-example.com/thumbnail.jpg">
 
  <meta property="og:url" content="http://euro-travel-example.com/index.htm">
 
  <meta name="twitter:card" content="summary_large_image">
 
 
  <!--  Non-Essential, But Recommended -->
 
  <meta property="og:site_name" content="European Travel, Inc.">
 
  <meta name="twitter:image:alt" content="Alt text for image">
 
 
  <!--  Non-Essential, But Required for Analytics -->
 
  <meta property="fb:app_id" content="your_app_id" />
 
  <meta name="twitter:site" content="@website-username">
 
  
 
  ...
 
  
 
```
 
7 0
4 followers
Viewed: 275 008 times
Version: 2.0
Category: Tutorials
Written by: rackycz
Last updated by: rackycz
Created on: Sep 19, 2019
Last updated: a year ago
Update Article

Revisions

View all history