• Resolved acann

    (@acann)


    Hi, I’m looking to add some schema to a specific page. I found tutorials on how to add the JSON-LD to a custom field, and then add some code to the header.php which pulls it in based on the page ID.

    However, I noticed that in the page editing screen of wordpress, it has a section to add “Page-specific Scripts.

    If I put the json-ld script in there, will it be output to the head or body? Is this acceptable or not? The script would look something like this (I think):

    <script type="application/ld+json">
    {
      "@context": "https://schema.org",
      "@type": "Product",
      "description": "The description of my product goes here",
      "name": "The name of my product goes here",
      "image": "https://www.mydomain.com/pictureofmyproduct.jpg",
      "offers": {
        "@type": "Offer",
        "price": "11.00",
        "priceCurrency": "USD"
      },
    }
    </script>

    Thanks for the help!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hello @acann

    May I ask why you’re using Schema mark up in the first place?

    IF the only reason you’re using Schema is SEO, I’d say don’t bother.

    You may find the long read I will link below interesting, but here’s the summery in relation to your issue.

    Backlinko analyzed one million search results and concluded:

    There is No Correlation Between Schema Markup and Rankings

    Here’s the Backlinko Research Article with regard to SEO (published Sept 2016)

    Thread Starter acann

    (@acann)

    No, ranking has nothing to do with it for me, in fact I didn’t think it had anything to do with ranking period (wasn’t aware that was a debate?). The schema (if I understand it) is used to enable rich cards/snippet in search results (among other things) by giving the search engine meta-data related to the content. For example, for pages containing a recipe, using the recipe schema enables showing a thumbnail of the dish, ratings, cook time, etc, right in the search result. My intention was to leverage the “product” markup for pages representing a product for sale, so that things like rating, product image, price, etc will be available for use in search result snippet displays.

    In theory, the primary reason for doing this is not ranking, but click through rate. At least, that is my intention in trying to use it, to make the result (wherever in the ranking it happens to be) appear more appealing to the searcher, so they will be that much more likely to click on it.

    However, in the case of this post I wasn’t asking about the importantance of schema, I was merely asking if scripts I put in the “page-specific script” box within the “edit page” screen of wordpress will be output in the body, or the head. I’m guessing the body, but wanted to check. Thanks for any assistance you can provide.

    @acann

    Noted with thanks for the detailed reply. In that case you may be right in using Schema mark up.

    I am not aware of any “page-specific script” section in the default wordpress page editor. It sounds like this may be a part of a plugin you are using.

    However, if you just want a short answer, create a test page and add random test text / script to its “page-specific script” box and then load the page. After doing so, you can right-click and then select “view page source”

    You will see the html code for your page. You can then look for the test text/script you added to determine if it’s added to the <head> or <body> section (most likely it will be in the head section)

    I can also try to help if you post a link to the test page.

    • This reply was modified 8 years, 3 months ago by j09.
    Thread Starter acann

    (@acann)

    Hi, sorry for the mixup, the section exists due to the Genesis Framework. It puts it in the body, not the head, but I’ve been told on Google Forums that it doesn’t matter, Google doesn’t care where it is.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Location for page specific scripts’ is closed to new replies.