links for 2011-05-18

meta name="robots"Element

<meta name="robots"

<meta name="robots" provides instructions to all search engines.

The meta name="robots" element can be used to tell robots not to index the content of a page, not to follow the links in a page, or both.

Robots can and will ignore the meta name="robots" element; do not worry about directing malware bots to your content; the meta name="robots" element is for standards-compliant, well-behaved bots.

Multiple values are allowed in a single meta name="robots" element; if you are not preventing bots from your content, don’t worry about meta name="robots" element, the default (not using one) is content="index, follow".


<meta name="robots"

meta name="robots" content="noindex,nofollow" />

Tells the bots not to index the page’s contents nor follow its links.


<meta name="robots" content="noindex,nofollow" />

meta name="robots" content="noodp" />

To prevent all search engines (that support the meta tag) from using this information for the page’s description, use the following:

content="noodp" stands for No Open Directory Project; Google sometimes uses descriptions from the Open Directory Project to generate the title and description snippets that can be seen in serps; this is telling all Search Engines to not use anything from the Open Directory Project.


<meta name="robots" content="noodp" />

<meta name="robots" content="noindex" />

content="noindex" tells search engines to deny the page from being indexed.


<meta name="robots" content="noindex" />

<meta name="robots" content="nofollow" />

content="nofollow" tells search engines to not follow any links on the page.


<meta name="robots" content="nofollow" />

<meta name="robots" content="noarchive" />

content="noarchive" tells search engines to not provide a cached copy of page in search results.


<meta name="robots" content="noarchive" />

<meta name="robots" content="nosnippet" />

content="nosnippet" tells search engines to not include a description of the page in search results as well as prevents caching of the page.


<meta name="robots" content="nosnippet" />

<meta name="robots" content="none" />

content="none" the same as using content="noindex, nofollow". Note: don’t confuse content="none" as an indicator of no robots restrictions. It will block all search engines from your content.


<meta name="robots" content="none" />

<meta name="robots" content="noimageindex" />

<meta name="robots" content="noimageindex" />tells Google Images Search results not to use your site as a referring page. Note: images on the page may still be included in the image index if they are linked to by other pages.


<meta name="robots" content="noimageindex" />

<meta name="googlebot"

<meta name="googlebot" provides instructions to only Googlebot.


<meta name="googlebot"

Googlebot by default indexes pages and follows links, so you don’t need to add content="index" or content="follow". What about other search engines/bots?

If you use conflicting values, Googlebot will follow the most restrictive.

meta name="googlebot" content="noodp" />

To specifically prevent Googlebot from using this information for a page’s description, use the following:

This is telling Google specifically not to use anything from the Open Directory Project.


<meta name="googlebot" content="noodp" />

If you use the robots meta element for other directives, you can combine those. For instance:


<meta name="googlebot" content="noodp, nofollow" />

<meta name="googlebot" content="noindex,noarchive,nofollow" />

Tells the googlebot not to index the page’s content, not to follow its links and not to provide a cached copy of the page in serps.


<meta name="googlebot" content="noindex,noarchive,nofollow" />

<meta name="googlebot" content="noimageindex" />

<meta name="googlebot" content="noimageindex" />tells googlebot not to include your images in Google Images Search results not to use your site as a referring page. Note: images on the page may still be included in the image index if they are linked to by other pages.


<meta name="googlebot" content="noimageindex" />

<meta name="msnbot" content="noindex,nofollow" />

Tells MSNbot not to index your page content and not to follow your links.


<meta name="msnbot" content="noindex,nofollow" />

<meta name="robots" content="noydir" />

Tell all bots not to use a Yahoo! Directory title or Yahoo! Directory description.


<meta name="robots" content="noydir" />

<meta name="slurp" content="noydir" />

Specifically tell Yahoo! bot name="slurp" to not crawl your page.


<meta name="slurp" content="noydir" />

links for 2011-05-17

links for 2011-05-14

How to Enable cors in WordPress

Enable CORS

Here’s a super easy way to enable cors in WordPress. First, open up header.php. The default code looks like so:


<?php
/**
 * @package WordPress
 * @subpackage Default_Theme
 */
?>
<!DOCTYPE html>
...

Now simply take the cors enabling php code and paste it into your header:


<?php /** @package WordPress @subpackage Default_Theme  **/
header("Access-Control-Allow-Origin: *"); 
?>
<!DOCTYPE html>
...

And that’s it; Now your blog enables cors! You can read more about cors here, as well as validate your sites for cors support. Support Linked Open Data!.

Promote cors Badges!

Help support Linked Open Data by enabling cors on your sites! You’ll also be promoting and furthering html5 and Web Standards while also enabling your sites for increased optimization which leads to better seo. It’s a win-win-win-win a lot situation!

These badges are a play on the shitastic Coors beer and come into two flavors:

Enable CORScors Original

Enable CORScors Mountain Style

You can download them all here, the original logo here, Enable cors Mountain Style or you can fork them from github. You can also follow me on github here.

Coors logos compliments of seeklogo.com, and can be found here (Coors Mountain Logo) and here (Coors Logo).

links for 2011-05-13

meta name="apple-mobile-web-app-capable" content="yes" Element

meta Element for Bookmarked Sites

If a user has added your web application to their springboard, the following meta element can remove the top bar from the browser:


<meta name="apple-mobile-web-app-capable" content="yes" />

And that’s all! The address bar is hidden until the user swipes down near the top bar of the application. With the address bar hidden, your web app can look just like a native app!

meta name="viewport" content="target-densitydpi=" Element

Targeting Android and hdpi


<meta name="viewport" content="target-densitydpi=high-dpi" />

Use hdpi as the target dpi. Medium and low density screens scale down as appropriate.

Targeting Android and mdpi


<meta name="viewport" content="target-densitydpi=medium-dpi: />

Use mdpi as the target mdpi. High density screens scale up and low density screens scale down. This is also the default behavior.

Targeting Android and ldpi


<meta name="viewport" content="target-densitydpi=low-dpi: />

Use ldpi as the target ldpi. Medium and high density screens scale up as appropriate.

meta name="viewport" content="target-densitydpi=device-dpi"

Stops Android from performing scaling; that means that you will have to make the necessary adjustments for each density via css and JavaScript.


<meta name="viewport" content="target-densitydpi=device-dpi" />

If you want to modify your web page for different densities, by using the -webkit-device-pixel-ratio css media query and/or the window.devicePixelRatio dom property, then you should set the meta name="viewport" content="target-densitydpi= to device-dpi. This stops Android from performing scaling in your web page and allows you to make the necessary adjustments for each density via css and JavaScript.