Rich Snippets WordPress Plugin Documentation

The Rich Snippets WordPress Plugin has a new home. Since version 2.0.0 you can find the documentation here.

Thank you for purchasing my Rich Snippets WordPress plugin. If you have any questions that are beyond the scope of this documentation sites, please feel free to email me via my contact form here. Thanks so much!

What this plugin can do for you

Have you ever seen that cool stuff that „pimps“ search results on google.com? It may look like this:

Rich Snippets Examples

This plugin helps you to generate this search results by using structured microdata. The plugin automatically pre-installs seven shortcodes that are ready-to-use. But it‘s also possible to create new shortcodes with microdata that you need for you purposes.

Quick Start

1. Installation

  1. Upload the rich-snippets-wordpress plugin folder to the /wp-content/plugins/ directory.
  2. Activate the Rich Snippets WordPress Plugin through the „Plugins“ menu in WordPress.
  3. Create and manage the plugin by going to the „Shortcode“ menu that appears in your admin panel.

2. Set up a Shortcode

  1. Go to your WordPress Admin Panel and click Shortcodes.
  2. Click „Add new“.
    Add new shortcode
  3. Type in a name of your new shortcode (1). The title will be automatically transformed into a suitable shortcode-name (2).
    Add new Shortcode
  4. Add the attributes you want to use with the new shorcode. For this, click „Add new attribute“ (1). Then type in your attribute-name into the field that appears (2). The shortcode will be updated as soon as you leave the field (3).?Please note: It‘s not possible to use special characters as WordPress cannot deal with that. So all special characters as well as spaces will be automatically removed.
    Add new Shortcode
  5. In the textarea-field below you can choose how the shortcode should look like. For this you can use HTML or PHP. If you use PHP please only use the <?php and ?> tags to open and close PHP-embedded scripts. Do not use <% or anything else. Please refer to #3 and #4 in this documentation for more information on how to use this field.
  6. In the second textarea it‘s possible to add your own CSS for styling the HTML code. It will be included in the frontends HTML-header.
  7. Save your new shortcode.
  8. Copy and paste the shortcode to use it anywhere in your posts or pages.

3. Use the HTML field

In the HTML / PHP Code textarea you can choose how your shortcode should look like in the frontend. The variables from the attributes are listed where it says „You can use the following placeholders:“.

Example 1:

If your shortcode is the following one:

[mynewshortcode name="raspberry"][/mynewshortcode]

You  can perform the source code like this:

<span>[name]</span>

In the frontend HTML code it will look like this:

<span>raspberry</span>

In fact: the placeholder will be filled with the content from the attribute.

Example 2:

If your shortcode is the following one:

[mynewshortcode icon="raspberry"] This is some content [/mynewshortcode]

You can perform the source code like this:

<span class="[icon]">[content]</span>

In the frontend HTML code it will look like this:

<span class="raspberry">This is some content</span>

Please watch the picture below. The [content]-variable (1) is always the content between the start- and the end-tag of the shortcode (see Example 2 above). To make WordPress doing shortcodes between shortcodes you can use the do_shortcode() PHP function listed in (2).?Every other placeholder, for example the [name]-attribute (3), can be used as variables inside the source code to represent the attributes content (4).

Insert PHP Code

Please check out the shortcodes that are delivered with this plugin as well.

4. Use PHP within the HTML field

If you use PHP please only use the <?php and ?> tags to open and close PHP-embedded scripts. Do not use <% or anything else. For every new shortcode PHP will create a function. In this function the placeshoders exists as variables. For example: The [name] attribute is available as the $name variable and you can do what you want with it.
Please note that the placeholders will still be replaced after the PHP code was executed.

5. Test

  • If you are using Rich Snippets you can test your new shortcodes by using Google‘s Rich Snippet Testing Tool which you can find here: http://www.google.com/webmasters/tools/richsnippet
  • Please note that search engines do not support all kinds of microdata at the moment.
  • Please also note: Google says that there is no guarantee that a Rich Snippets will be shown for your page on actual search results.