data-vocabulary.org schema deprecated fix
data-vocabulary.org schema deprecated fix

data-vocabulary.org schema deprecated fix

Google recently launched a webmaster newsletter about data-vocabulary.org schema deprecated .

We will tell you how to change the data-vocabulary breadcrumb markup to schema.org/BreadcrumbList.

This is the new breadcrumb markup supported by all major search engines.

Open file /oc-includes/osclass/classes/Breadcrumb.php

And from 299 line change this code:

                $text .='itemscope itemtype="http://data-vocabulary.org/Breadcrumb" >';

                // set separator

                if( $i > 0 ) {

                    $text .= ' ' . $separator . ' ';

                }

                // create span tag

                $title = '<span itemprop="title">' . $this->aLevel[$i]['title'] . '</span>';

                if( array_key_exists('url', $this->aLevel[$i]) ) {

                    $title = '<a href="' . osc_esc_html($this->aLevel[$i]['url']) . '" itemprop="url">' . $title . '</a>';

                }

                $node[] = $text . $title . '</li>' . PHP_EOL;

            }


            $result  = '<ul class="breadcrumb">' . PHP_EOL;

TO THIS CODE:

                $text .='itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem" >';

                // set separator

                if( $i > 0 ) {

                    $text .= ' ' . $separator . ' ';

                }

                $b = $i + 1;

                // create span tag

                $title = '<span itemprop="name">' . $this->aLevel[$i]['title'] . '</span>';

                if( array_key_exists('url', $this->aLevel[$i]) ) {

                    $title = '<a href="' . osc_esc_html($this->aLevel[$i]['url']) . '" itemprop="item">' . $title .'<meta itemprop="position" content="' . $b . '" /></a>';

                }

if( ($i == (count($this->aLevel) - 1)) && ($i != 0) ) {

$title = '' . $title .'<meta itemprop="position" content="' . $b . '"';

                }

                $node[] = $text . $title . '</li>' . PHP_EOL;

            }


            $result  = '<ul class="breadcrumb" itemscope itemtype="http://schema.org/BreadcrumbList">' . PHP_EOL;

The problem is resolved.

You can test the new markup in a tool from Google:

https://search.google.com/structured-data/testing-tool