Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

HTML

Shane McC
Shane McC
3,005 Points

Schema Markup, Am I doing this correctly?

Hi Everyone,

I own a local business and I wanted to know if I'm writing my schema markup correctly so that all of the major search engines know what type of business I own. I believe I'm doing it correctly but I would appreciate second opinion(s). Thanks.

    <div itemscope itemtype="http://schema.org/AutoDealer">
    <tr>
        <span><td><b itemprop="name">My Dealership</b></td></span>
        <span><td itemprop="address">5671 Private Road</td></span>
        <span><td itemprop="addressRegion">Georgia</td></span>
        <span><td itemprop="addressLocality">College Park</td></span>
        <span><td itemprop="postalCode">12345</td></span>
        <span><td itemprop="telephone">800123456789</td></span>
        <span><td><center><a itemprop="url" href="/dealers/dealerships.php?id=647">Click Here</a></center></td></span>
    </tr>
    </div>

You're using a few tags that have been deprecated.

<div itemscope itemtype="http://schema.org/AutoDealer">
<tr>
    <td><span itemprop="name">My Dealership</span></td>
    <td><span itemprop="address">5671 Private Road</span></td>
    <td><span itemprop="addressRegion">Georgia</span></td>
    <td><span itemprop="addressLocality">College Park</span></td>
    <td><span itemprop="postalCode">12345</span></td>
    <td><span itemprop="telephone">800123456789</td></span>
    <td><span itemprop="url"><a href="/dealers/dealerships.php?id=647">Click Here</a></span></td>
</tr>

</div>

Shane McC
Shane McC
3,005 Points

Hi Rhys,

Thanks for the reply. The syntax you provided in your response looks the same as mine. Which tags are deprecated?

Wow....for some reason I can't edit my reply.

<div itemscope itemtype="http://schema.org/AutoDealer">

<tr> <td><span itemprop="name">My Dealership</span></td> <td><span itemprop="address">5671 Private Road</span></td> <td><span itemprop="addressRegion">Georgia</span></td> <td><span itemprop="addressLocality">College Park</span></td> <td><span itemprop="postalCode">12345</span></td> <td><span itemprop="telephone">800123456789</span></td> <td><span itemprop="url"><a href="/dealers/dealerships.php?id=647">Click Here</a></span></td> </tr>

It's actually not quite the same. The span tags are within the <td> tags, the <b> tags are also removed (you should use <strong> or <em>, or CSS for styling type.

html doctor

:( Curse the abilty to not edit a response...

It's actually not quite the same. The span tags are within the td tags, the tags are also removed (you should use em or strong tags , or CSS for styling type.

Shane McC
Shane McC
3,005 Points

Ahhh yes!

I understand what your saying now. I've edited my information below. I think it's correct. Please give me yours thoughts. Thanks

(In the syntax below I'm replacing the actual business name and info with the variables.)

    <div itemscope itemtype="http://schema.org/AutoDealer">
    <tr>
        <td><span itemprop="name"><?=$dealership?></span></b></td>
        <td><span itemprop="address"><?=$address?></span></td>
        <td><span itemprop="addressRegion"><?=$state?></span></td>
        <td><span itemprop="addressLocality"><?=$city?></span></td>
        <td><span itemprop="postalCode"><?=$zip?></span></td>
        <td><span itemprop="telephone"><?=$phone?></span></td>
        <td><span itemprop="url"><a href="/dealers/dealerships.php?id=<?=$id?>">Click Here</a></span></td>
    </tr>
    </div>

There we go. The only thing left is /b - which is probably just a typo.

Shane McC
Shane McC
3,005 Points

Sweet,

Thanks Rhys.

It was a typo. I was missing the opening <b> tag.

    <div itemscope itemtype="http://schema.org/AutoDealer">
    <tr>
        <td><b><span itemprop="name"><?=$dealership?></span></b></td>
        <td><span itemprop="address"><?=$address?></span></td>
        <td><span itemprop="addressRegion"><?=$state?></span></td>
        <td><span itemprop="addressLocality"><?=$city?></span></td>
        <td><span itemprop="postalCode"><?=$zip?></span></td>
        <td><span itemprop="telephone"><?=$phone?></span></td>
        <td><span itemprop="url"><a href="/dealers/dealerships.php?id=<?=$id?>">Click Here</a></span></td>
    </tr>
    </div>

Actaully, what I meant was that you want instead to remove b* since it is deprecated. You could instead use the **em tag.

Shane McC
Shane McC
3,005 Points

Is there anyway I can give you a best answer? kinda like stack over flow.

1 Answer

Shane McC
Shane McC
3,005 Points

Wow,

Didn't know the bold tag was deprecated. I've got to work on my HTML!

    <div itemscope itemtype="http://schema.org/AutoDealer">
    <tr>
        <td><em><span itemprop="name"><?=$dealership?></span></em></td>
        <td><span itemprop="address"><?=$address?></span></td>
        <td><span itemprop="addressRegion"><?=$state?></span></td>
        <td><span itemprop="addressLocality"><?=$city?></span></td>
        <td><span itemprop="postalCode"><?=$zip?></span></td>
        <td><span itemprop="telephone"><?=$phone?></span></td>
        <td><span itemprop="url"><a href="/dealers/dealerships.php?id=<?=$id?>">Click Here</a></span></td>
    </tr>
    </div>

or I was thinking about doing this (using <strong></strong>). I believe <strong> is up-to-date markup.

    <div itemscope itemtype="http://schema.org/AutoDealer">
    <tr>
        <td><strong><span itemprop="name"><?=$dealership?></span></strong></td>
        <td><span itemprop="address"><?=$address?></span></td>
        <td><span itemprop="addressRegion"><?=$state?></span></td>
        <td><span itemprop="addressLocality"><?=$city?></span></td>
        <td><span itemprop="postalCode"><?=$zip?></span></td>
        <td><span itemprop="telephone"><?=$phone?></span></td>
        <td><span itemprop="url"><a href="/dealers/dealerships.php?id=<?=$id?>">Click Here</a></span></td>
    </tr>
    </div>

Thanks again