Content last modified Monday 6 March 2017
hop to #bottom
Current version:
About It:
Get it:
Rate it:
  • Helpful?
  • 0 Yes
  • 0 No
Flag it:

If you'd like to provide updated information and do not have access to directly edit, please contact the site admin; thanks!


I’ve updated the google_hilite mod for TextPattern by Dean Allen. I’ve gone ahead and changed it into a plugin, so rather than uploading a php file and inserting php into your pages, you now just insert tags to get the same functionality.

The two tags are:

  • <txp:myt_google_hilite />
  • <txp:myt_google_welcome />

You also need to add .hilite { background-color: [color of your choice]; } to your style sheet.


There is a new attribute on the <txp:myt_google_hilite /> tag. You can add the color=”#[hex value]” or color=”[text color like yellow or white]” attribute to define the hilite color. If no color is defined, it uses the color “#FFFF99”.


There is another new attribute on the <txp:myt_google_hilite /> tag. You can add the class=”[class]” attribute to define the class for the hilite color to avoid interfering with your own styles. If no class is defined, it uses the class “hilite”.

There is a new attribute on the <txp:myt_google_welcome /> tag. You can add the text=”[text]” attribute to set the text that will be used to welcome Google users. If the text attribute is omitted, it defaults to “[Google search terms are highlighted]”.

Many thanks to Andy Warwick for all his help debugging and suggesting features!

Article Request Count:
Initially released:
Posted here:
19 Nov 2006
Article modified:
20 Nov 2006

If there is a comment form at the Information URL, you may want to leave your comments/questions there for quicker feedback. Otherwise, comment away:

Commenting is closed for this article.

Commented (5)

I think this would be a great plugin but where must I insert the call to the plugin? Into every article?

The calls can be inserted into the page template. So in the head section of the page template is where you’d insert the hilite tag, and wherever you wanted the welcome section on a page is where you’d insert the welcome tag.

Perfect! Thanks for this great plugin!

Hi, thanks for the plugin. Is there anyway to stop it highlighting the search terms which appear within the tag?

Not quite sure what you mean by this. Do you mean a way to add an attribute such as exclude=“term1,term2,term3” and have it not show highlight those terms?

Subscribe to this article's comments RSS feed. [ ? ]   View Recent Comments across the site.

Would you care to write a comment?

You know you want to visit the Archives.




There are also tag clouds, 'cause those are fun.
Published with Textpattern