Jump to content


Photo

[Snippet] MetaTagsExtra


  • Please log in to reply
18 replies to this topic

#1 lloyd_borrett

lloyd_borrett

    Loves Etomite Forums!

  • Member
  • PipPipPipPip
  • 607 posts

Posted 30 April 2007 - 02:40 AM

File Name: MetaTagsExtra
File Submitter: lloyd_borrett
File Submitted: 30 Apr 2007
File Updated: 11 Sep 2010
File Category: Search Engines

* Description:
 *  Returns XHTML for document meta tags: 
 *   Content-Type, Content-Language, Generator,
 *   Title, Description, Keywords, Abstract, Author, Copyright, 
 *   Robots, Googlebot, Cache-Control, Pragma, Expires, Last Modified,
 *   Google Map Key, Google and Yahoo Sitemap Verification Keys,
 *   SafeSurf / PICS-Label, No-Email-Collection, Distribution and Rating.
 *  Can also return XHTML for Dublin Core Metadata Initiative meta tags:
 *   DC.format, DC.language, DC.title, 
 *   DC.description, DC.subject, DC.title.alternative,
 *   DC.publisher, DC.creator, DC.rights,
 *   DC.date.created, DC.date.modified, DC.date.valid and DC.identifier.
 *  Can also return the GeoURL and GeoTags meta tags:
 *   DC.title, ICBM, geo.position, geo.placename and geo.region.
 * 
 * Snippet Author:
 *   Miels with mods by Lloyd Borrett (lloyd@borrett.id.au)
 *
 * 2.6B - 2009-10-12 - Dean Clinton
 * Fixed Etomite Charset issue.
 * Fixed Problem With Robots Tags
 * Reordered title tag to  pagetitle - longtitle - sitename
 * Removed Personal Data
 * Removed Old Changelog Data (prior to v2.6)

Click here to download this file

#2 lloyd_borrett

lloyd_borrett

    Loves Etomite Forums!

  • Member
  • PipPipPipPip
  • 607 posts

Posted 30 April 2007 - 04:31 AM

G'day,

No Email Collection

This new version of MetaTagsExtra came about when I decided it was time to add support for the Project Honey Pot no-email-collection meta tag. See http://www.projecthoneypot.org/.

This meta tag has a link to the legal terms and conditions of use of the web site. A model set of terms and conditions is on the Project Honey Pot website.

The Project Honey Pot team also recommended you add a link into your robots.txt file, e.g.
No-Email-Collection: http://www.mydomain.com/legal-notices.htm

Google Map and Site Map Tags

While adding the other tag I thought it was about time I moved my Google Maps, plus Google and Yahoo sitemap verification tags into MetaTagsExtra.

SafeSurf & ICRA Tags

While doing the above I also thought it was about time I automated my support of the SafeSurf and TCRA PICS labels. See http://www.classify.org/safesurf/ and http://www.icra.org/webmasters/.

I typically use both of these ways of indicating that my websites are safe on most web sites I build.

Favicon

While doing all of the above, I decided to use MetaTagsExtra to automate my use of favicons images as well.

Content Type

Ralph had suggested a better way to set the content-type meta tag. So instead of using a site wide setting specified in the snippet, the snippet now uses Ralph's suggestion of getting the values from the document and Etomite system settings.

Best Regards, Lloyd Borrett.

Edited by lloyd_borrett, 30 April 2007 - 10:03 PM.


#3 Ralph

Ralph

    Loves Etomite Forums!

  • Admin
  • 6,539 posts

Posted 30 April 2007 - 03:16 PM

Lloyd, how about adding my document-centric content type code in place of your default site-centric content type...??? I've run into issues on several sites due to this constraint...

#4 lloyd_borrett

lloyd_borrett

    Loves Etomite Forums!

  • Member
  • PipPipPipPip
  • 607 posts

Posted 30 April 2007 - 09:59 PM

G'day Ralph,

I did do that as a part of this update. The snippet now uses the following code to set the content type:
$content_type = "[*contentType*]; charset=[(etomite_charset)]";

Or have I missed something?

Best Regards, Lloyd Borrett.

Edited by lloyd_borrett, 30 April 2007 - 10:05 PM.


#5 Ralph

Ralph

    Loves Etomite Forums!

  • Admin
  • 6,539 posts

Posted 30 April 2007 - 10:18 PM

G'day Ralph,

I did do that as a part of this update. The snippet now uses the following code to set the content type:

$content_type = "[*contentType*]; charset=[(etomite_charset)]";

Or have I missed something?

Best Regards, Lloyd Borrett.

No, that's it Lloyd... I missed it when I viewed the code after quickly viewing the changelog for the snippet... Sorry about that...

#6 darren

darren

    Likes Etomite Forums!

  • Member
  • PipPip
  • 251 posts

Posted 11 April 2008 - 07:36 PM

A few questions with this snippet, which I really like.

1. Just noticed that there was a newer version than I have installed, so tried this version out (2.6)
I recieved a parse error at 653 error, this is in the geo_tags code. even though i had use geo_tags set to false, I continued to get the error until I just commented out the entire if ($geo_tags) {} code... wondering if anyone else encountered this and if there are any other 'fixes'. Not a big deal otherwise.

2. With the older version, if a page is set to not show in the menu, some of the tags were generated wrong. like the creation/last modified dates were in 1969, title tag was not being generated etc. (this is why i looked for a newer version...) With v 2.6 the page isn't even parsed:

« Error »Etomite encountered the following error while attempting to parse the requested resource:« Execution of a query to the database failed »      SQL: SELECT fullname FROM `scceto`.etomite_user_attributes WHERE `scceto`.etomite_user_attributes.id = ;      [Copy SQL to ClipBoard] Parser timing  MySQL: 	0.0078 s s	(4 Requests)  PHP: 	0.0364 s s	   Total: 	0.0441 s s

This error only occurs with pages not shown in the menu... but I do need to view those pages ...what's going on?

thks

*edit - started from original 2.6 file and those pages are being parsed, now, I must have missed commenting out something. Still have original issue of tags for example -
<meta content="1969-12-31" name="DC.date.created"/>
<meta content="1969-12-31" name="DC.date.modified"/>

Edited by darren, 11 April 2008 - 07:45 PM.


#7 Dean

Dean

    Loves Etomite Forums!

  • Admin
  • 4,787 posts

Posted 15 August 2008 - 10:14 PM

There are a few bugs with this snippet!
On my install, for some reason (1.1), it's incorrectly detecting searchable pages and telling google to drop them!
Also, I've fixed bug 42
There are a couple of changes you need to make to the defaults within the snippet (your designer name, and location for example)

Below is the updated code:

UPDATED ATTACHMENT FURTHER DOWN THE PAGE


#8 deadline

deadline

    Etomite Forum Fan

  • Member
  • Pip
  • 68 posts

Posted 19 August 2008 - 10:48 AM

There are a few bugs with this snippet!
On my install, for some reason (1.1), it's incorrectly detecting searchable pages and telling google to drop them!
Also, I've fixed bug 42
There are a couple of changes you need to make to the defaults within the snippet (your designer name, and location for example)


Hi,
I reported this fact in a previous post :
http://www.etomite.c...c...=&pid=47956

deadline

#9 Dean

Dean

    Loves Etomite Forums!

  • Admin
  • 4,787 posts

Posted 19 August 2008 - 02:28 PM

Thanks, I never noticed that post - the main thing is that I've updated the snippet (above) which also fixes another bug (charset)...

#10 Dean

Dean

    Loves Etomite Forums!

  • Admin
  • 4,787 posts

Posted 12 October 2009 - 03:31 PM

Just a heads up to those using the MetaTagsExtra snippet; not only to make sure you use the updated version I've included above, but also that Google have changed their meta tag they use - replace "verify-v1" with "google-site-verification" :)

#11 lloyd_borrett

lloyd_borrett

    Loves Etomite Forums!

  • Member
  • PipPipPipPip
  • 607 posts

Posted 12 October 2009 - 09:49 PM

There are two BIG problems with this snippet.

It uses the Etomite setting for whether the page is 'searchable' to tell the search engines if it's searchable or not.

But this doesn't really make sense. Etomite's setting for the page is all about if you want the page to be searchable within your web site. There are times when you don't want the page to be searchable within the site, but you still want search engines to index the page, and vica versa.

Same goes for cache control. Etomite's 'cacheable' setting is there for an entirely different reason than whether seach engines should cache the page or not.

I've suggested a number of times that Etomite could use some additional page settings to make it easier to do SEO work on an Etomite based web site. Maybe one day they'll be added.

Also, for better SEO, I've found it pays to generate the title meta tag in the form: Page Title and Long Title, then the Site Name. I'll see if I can put together a version withh all of these changes and fixes included.

By the way, the places where double quotes are replaced with a HTML entity value won't work if you cut and paste the code in the post above.

Best Regards, Lloyd Borrett.

Edited by lloyd_borrett, 12 October 2009 - 09:54 PM.


#12 Dean

Dean

    Loves Etomite Forums!

  • Admin
  • 4,787 posts

Posted 12 October 2009 - 09:54 PM

By the way, the places whre double quotes are replaced with a HTML entity value won't work if you cut and paste the code above.


I don't understand what you mean?

#13 lloyd_borrett

lloyd_borrett

    Loves Etomite Forums!

  • Member
  • PipPipPipPip
  • 607 posts

Posted 12 October 2009 - 10:03 PM

$description = str_replace('"', '"', trim($description));

Should be:
$description = str_replace('"', '"', trim($description));

Or if this gets currupted (which it did), in the second '"', the " should be the entity value & # 3 4 ;

This happens a few places in the snippet. Things like this are why the snippet needs to be a download and not in a forum post.

Edited by lloyd_borrett, 12 October 2009 - 10:04 PM.


#14 Dean

Dean

    Loves Etomite Forums!

  • Admin
  • 4,787 posts

Posted 12 October 2009 - 10:06 PM

Ah. I didn't know that. It did it in 6 places.
Thanks for that - if you manage to update the snippet, I fixed the characters problem (where it wasn't generating the charset) and stripped out the personal data of yours....

#15 Dean

Dean

    Loves Etomite Forums!

  • Admin
  • 4,787 posts

Posted 12 October 2009 - 10:33 PM

This should be a working copy.. Attached File  MetaTagsExtra_v26b.php   20.5K   20 downloads


* 2.6B - 2009-10-12 - Dean Clinton
 * Fixed Etomite Charset issue.
 * Fixed Problem With Robots Tags
 * Reordered title tag to  pagetitle - longtitle - sitename
 * Removed Personal Data
 * Removed Old Changelog Data (prior to 2.6)


#16 Dean

Dean

    Loves Etomite Forums!

  • Admin
  • 4,787 posts

Posted 11 September 2010 - 07:17 PM

Updated original post to include newest version.

#17 lloyd_borrett

lloyd_borrett

    Loves Etomite Forums!

  • Member
  • PipPipPipPip
  • 607 posts

Posted 25 June 2012 - 01:20 AM

G'day,

I've updated this snippet to add some more recent SEO developments.

* 2.8 - 2012-06-25 - Lloyd Borrett
* Fixed Etomite charset issue.
* Changed to use google-site-verification instead of verify-v1 for the Google sitemap verification meta tag.
* Added support for Microsoft and Alexa verification keys.
* Added support for the Open Graph protocol meta tags.
* Added support for the Twitter meta tags.
* Added support for the canonical link element.
* Added support for the Google author link.
* Added comments to show where the snippet output begins and ends.

You can see it in use at http://www.scubadoctor.com.au

Best regards, Lloyd Borrett.

Attached Files


Edited by lloyd_borrett, 25 June 2012 - 01:23 AM.


#18 efikim

efikim

    Etomite Forum Newbie

  • Member
  • 8 posts

Posted 25 June 2012 - 06:44 PM

Thanks Lloyd!

I guess its time to work out how to use the Open Graph stuff - I've been pushing it to one side, but its getting built in to Wordpress plugin now, too.

#19 PaulD

PaulD

    Likes Etomite Forums!

  • Developers
  • PipPip
  • 413 posts

Posted 06 August 2012 - 04:07 AM

Im sick of FB and their hype and their finger in all the pies. I can see why FB want us to do all the work for them, and offer little in return. Perhaps its time for an open source facebook clone to appear. WikiBook perhaps. OpenBook.

I think (and more and more of me hopes) that FB will go the way of yahoo, only quicker this time. Apparently 'the kids' are not so hot on it as they already see it as something their mums and dads do.

Since open graph only seems to apply to 'like' buttons from FB, I certainly wont be using them.

I wonder if having meta tags at all really helps when it comes to Google SEO. Some people say it does, some say it doesn't. Ironically I am going to google it now and refresh my opinions on the whole issue of meta tags.

Personally I find all meta tags a bit pointless. Google.co.uk only has one that I can find,
<meta itemprop="image" content="/images/google_favicon_128.png">
.

Best wishes,

Paul.

Edited by PaulD, 06 August 2012 - 04:09 AM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users