Wednesday, 29 July 2015

SEO and H1 Tags

The header tag, or the <h1> tag in HTML, will usually be the title of a post, or other1 emphasized text on the page.  It will usually be the largest text that stands out.  There are other header tags in HTML too, like an h2, h3, h4, etc.  Each can have a lesser degree of importance on the page, but it really depends on how your HTML/CSS guy did the layout.  Sometimes, they make your logo the h1 – because it’s in the “header”, but it would be best to make the h1 the title of the page or post instead.

How you write your header, or h1 tag, is going to be similar to how you wrote your title tag.  Sometimes these can be the same, and that’s OK.  Here are a few tips:
1.  Put your header tag <h1> </h1> at the top of the page, preferably after the <body> tag.
2.  Are you targeting the keywords you wish to rank higher for?  If not, go in and modify your tags slightly to include those words.  If your h1 happens to be an image, use the image alt tag to add those juicy keywords.
3. Can I have more than 1 header tag on the page?  Google will not penalize you, but one is preferred.  If you have a need for multiple titles, then perhaps it should be broken into multiple pages, or use one h1, or multiple h2’s. 
Ref: http://pearanalytics.com/blog/2014/how-to-write-a-header-tag-h1-for-seo/

Thursday, 9 July 2015

Faster MySQL drops and imports with Drush

Since moving to a local development model, I've been doing far more database imports. I'd been doing them through phpMyAdmin until a colleague showed me how much faster they were with Drush. It's a two-step process:
  • drush sql-drop - This drops the tables on your existing database.
  • drush sqlc < path/to/filename_here.sql - This imports the file into your database.

Notes

  • Both of these commands must be run inside the structure of your Drupal site. Be careful about where you run them -- if you're in the wrong site, you'll drop the wrong database. 
  • If you're having trouble remembering which carat to use, remember that the < pointing away from the file and toward sqlc means that the filename is being dropped into your database, not that the database is being exported to a file.
  • Remember to update the path to your database relative to where you're running the command. If you store your SQL file in sites/default/databases and you're running the command from inside sites/default/databases, just drush sqlc < filename_here.sql is plenty. If you were running it from, say, sites/all/themes, you'd need to add a path so Drush could find the file you were pointing to.
Ref: http://www.webbykat.com/2012/06/faster-mysql-drops-and-imports-drush

PHP Codesniffer - Ignore warning errors

 Use below command to ignore warnings while generating report. phpcs -n /path_to_directory/ The above command will result only errors and ig...