JSM’s Google Off for Preformatted Content

FYI

  • Plugin Name: JSM's Google OFF for Preformatted Content
  • Stable Version: 1.0.0
  • Author: JS Morisset
  • Description: Add googleoff/googleon HTML comment tags before/after preformatted content and textarea HTML tags.
  • License: GPLv3
  • Requires At Least: WordPress 3.8
  • Tested Up To: WordPress 5.0
  • Last Updated: 1 day ago
  • Plugin Homepage »

Add googleoff/googleon HTML comment tags before/after preformatted content and textarea HTML tags — ie. includes both the <pre></pre> and <textarea></textarea> HTML tags. This is especially useful to fix "syntax highlighting" plugins that substitute preformatted HTML tags by textareas. ;-)

The plugin uses a PHP output buffer — instead of WordPress content, excerpt, and comment filters — to prevent caching and HTML optimizing plugins from removing the googleoff/googleon HTML comments.

Example:

There are no plugin settings — simply install and activate the plugin.

See Google's Preparing for a Crawl document for more info about googleoff/googleon:

Excluding Unwanted Text from the Index

There may be Web pages that you want to suppress from search results when users search on certain words or phrases. For example, if a Web page consists of the text "the user conference page will be completed as soon as Jim returns from medical leave", you might not want this page to appear in the results of a search on the terms "user conference". You can prevent this content from being indexed by using googleoff/googleon tags. By embedding googleon/googleoff tags with their flags in HTML documents, you can disable:

  • The indexing of a word or portion of a Web page.
  • The indexing of anchor text.
  • The use of text to create a snippet in search results.