Difference between revisions of "How to add Structured data for rich snippets"

From JReviews Documentation
Jump to: navigation, search
(Adding addition Structured Data markup properties through Custom Fields)
Line 33: Line 33:
  
 
To add the "brand" property, change it like this:
 
To add the "brand" property, change it like this:
<pre>
+
<source lang="html">
 
<span itemprop="brand">{fieldtext}</span>
 
<span itemprop="brand">{fieldtext}</span>
</pre>
+
</source>
 +
 
 +
You can also add new properties that remain invisible to the site visitor by using a meta tag:
 +
 
 +
<source lang="html">
 +
<meta itemprop="brand" content="{fieldtext}">
 +
</source>
 +
 
 +
This approach can be useful if you need to add many properties and you prefer to do it using a separate banner custom field.
  
 
After making the changes, check the listing in the [https://search.google.com/structured-data/testing-tool Rich Snippets Testing Tool] again to see if the changes are valid and if the new property is included:
 
After making the changes, check the listing in the [https://search.google.com/structured-data/testing-tool Rich Snippets Testing Tool] again to see if the changes are valid and if the new property is included:

Revision as of 11:43, 25 May 2018


Schema.org Structured Data in JReviews

JReviews adds Schema.org Structured Data HTML markup to listing detail pages so Google can use that data to index your content better and present it more prominently in search results. Here is an example of Google search results with breadcrumbs and rating rich snippets:

Google-results.jpg

The code required for this is included in JReviews by default, but keep in mind that Google doesn't automatically include rich snippets in search results for every site just because the site contains the required code, other factors like site popularity are considered as well. If Google detects fake reviews or reviews copied from other sites, that can also be a reason why rich snippets aren't included in search results.

Selecting the right Schema.org Object Type

The first thing that you should do is set the main Schema.org Object Type for your listings. This is done in the Listing Types Manager for each individual listing type. For example, if you have a listing type for Products, the correct Schema.org object would be http://schema.org/Product. Edit the listing type in the Listing Types Manager and you will find the setting in the SEO Manager tab:

Schema-object-type.png

Check the list of all available Schema.org objects. Choose the most accurate object type that describes your listing (what is being reviewed). Don't add the "Rating" or "Aggregate Rating" objects because they are included in JReviews by default as sub-objects of the main object.

Validating your pages

To improve your chances of rich snippets being included in search results you should always validate your pages using the Rich Snippets Testing Tool to check if there are any errors. If errors exist, do what Google suggests to fix them.

Adding addition Structured Data markup properties through Custom Fields

Most Schema.org objects have many properties that describe the listing. For example, the Product object type has a brand property. If your product listing has a custom field that outputs the name of the product brand, you can add the property name to the field output so that Google will know which part of the product page is a brand name. This can be done using the Output Format text area of individual custom fields in the Fields Manager.

For example, the Output Format of a field looks like this:

{fieldtext}

To add the "brand" property, change it like this:

Invalid language.

You need to specify a language like this: <source lang="html4strict">...</source>

Supported languages for syntax highlighting:

4cs, 6502acme, 6502kickass, 6502tasm, 68000devpac, abap, actionscript, actionscript3, ada, algol68, apache, applescript, apt_sources, arm, asm, asp, asymptote, autoconf, autohotkey, autoit, avisynth, awk, bascomavr, bash, basic4gl, bf, bibtex, blitzbasic, bnf, boo, c, c_loadrunner, c_mac, caddcl, cadlisp, cfdg, cfm, chaiscript, cil, clojure, cmake, cobol, coffeescript, cpp, cpp-qt, csharp, css, cuesheet, d, dcl, dcpu16, dcs, delphi, diff, div, dos, dot, e, ecmascript, eiffel, email, epc, erlang, euphoria, f1, falcon, fo, fortran, freebasic, freeswitch, fsharp, gambas, gdb, genero, genie, gettext, glsl, gml, gnuplot, go, groovy, gwbasic, haskell, haxe, hicest, hq9plus, html4strict, html5, icon, idl, ini, inno, intercal, io, j, java, java5, javascript, jquery, kixtart, klonec, klonecpp, latex, lb, ldif, lisp, llvm, locobasic, logtalk, lolcode, lotusformulas, lotusscript, lscript, lsl2, lua, m68k, magiksf, make, mapbasic, matlab, mirc, mmix, modula2, modula3, mpasm, mxml, mysql, nagios, netrexx, newlisp, nsis, oberon2, objc, objeck, ocaml, ocaml-brief, octave, oobas, oorexx, oracle11, oracle8, oxygene, oz, parasail, parigp, pascal, pcre, per, perl, perl6, pf, php, php-brief, pic16, pike, pixelbender, pli, plsql, postgresql, povray, powerbuilder, powershell, proftpd, progress, prolog, properties, providex, purebasic, pycon, pys60, python, q, qbasic, rails, rebol, reg, rexx, robots, rpmspec, rsplus, ruby, sas, scala, scheme, scilab, sdlbasic, smalltalk, smarty, spark, sparql, sql, stonescript, systemverilog, tcl, teraterm, text, thinbasic, tsql, typoscript, unicon, upc, urbi, uscript, vala, vb, vbnet, vedit, verilog, vhdl, vim, visualfoxpro, visualprolog, whitespace, whois, winbatch, xbasic, xml, xorg_conf, xpp, yaml, z80, zxbasic


<span itemprop="brand">{fieldtext}</span>

You can also add new properties that remain invisible to the site visitor by using a meta tag:

Invalid language.

You need to specify a language like this: <source lang="html4strict">...</source>

Supported languages for syntax highlighting:

4cs, 6502acme, 6502kickass, 6502tasm, 68000devpac, abap, actionscript, actionscript3, ada, algol68, apache, applescript, apt_sources, arm, asm, asp, asymptote, autoconf, autohotkey, autoit, avisynth, awk, bascomavr, bash, basic4gl, bf, bibtex, blitzbasic, bnf, boo, c, c_loadrunner, c_mac, caddcl, cadlisp, cfdg, cfm, chaiscript, cil, clojure, cmake, cobol, coffeescript, cpp, cpp-qt, csharp, css, cuesheet, d, dcl, dcpu16, dcs, delphi, diff, div, dos, dot, e, ecmascript, eiffel, email, epc, erlang, euphoria, f1, falcon, fo, fortran, freebasic, freeswitch, fsharp, gambas, gdb, genero, genie, gettext, glsl, gml, gnuplot, go, groovy, gwbasic, haskell, haxe, hicest, hq9plus, html4strict, html5, icon, idl, ini, inno, intercal, io, j, java, java5, javascript, jquery, kixtart, klonec, klonecpp, latex, lb, ldif, lisp, llvm, locobasic, logtalk, lolcode, lotusformulas, lotusscript, lscript, lsl2, lua, m68k, magiksf, make, mapbasic, matlab, mirc, mmix, modula2, modula3, mpasm, mxml, mysql, nagios, netrexx, newlisp, nsis, oberon2, objc, objeck, ocaml, ocaml-brief, octave, oobas, oorexx, oracle11, oracle8, oxygene, oz, parasail, parigp, pascal, pcre, per, perl, perl6, pf, php, php-brief, pic16, pike, pixelbender, pli, plsql, postgresql, povray, powerbuilder, powershell, proftpd, progress, prolog, properties, providex, purebasic, pycon, pys60, python, q, qbasic, rails, rebol, reg, rexx, robots, rpmspec, rsplus, ruby, sas, scala, scheme, scilab, sdlbasic, smalltalk, smarty, spark, sparql, sql, stonescript, systemverilog, tcl, teraterm, text, thinbasic, tsql, typoscript, unicon, upc, urbi, uscript, vala, vb, vbnet, vedit, verilog, vhdl, vim, visualfoxpro, visualprolog, whitespace, whois, winbatch, xbasic, xml, xorg_conf, xpp, yaml, z80, zxbasic


<meta itemprop="brand" content="{fieldtext}">

This approach can be useful if you need to add many properties and you prefer to do it using a separate banner custom field.

After making the changes, check the listing in the Rich Snippets Testing Tool again to see if the changes are valid and if the new property is included:

Rich-snippets-test-results.png

If there are no errors, you are all set and hopefully, Google will some day include the structured data in search results.