[Resolved] Inserting header code before RankMath header code?

Home Forums Support Inserting header code before RankMath header code?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1163828
    Michael

    Hi guys,

    I am having a weird issue (yes indeed, another one ;)) whereby my structured markup I am inserting via a wp_head hook on the page I am testing on is getting tangled up within the RankMath breadcrumb list. I have written to RankMath but not received a resolution yet. What I wanted to test though myself in the meantime is if moving my markup before the RankMath header code would help. Currently it is inserted after the RankMath code. Please can you tell me if there is a way to make sure that my markup header code comes first in the line so to speak?

    I am having to add the markup myself because their set up only appears to allow for 1 product schema offer per page, which doesn’t work in this case since we have 4 vases each with different prices etc.

    I am working on our Vases page (https://reclaimdesign.org/vases-reclaimed-wood-stands.html). When I view source, The RankMath code is coming in at line 16:

    <!-- Search Engine Optimization by Rank Math - https://s.rankmath.com/home -->
    <title>4 Glamorous Sustainable Vases – Home Decor | Reclaim Design</title>
    <meta name="description" content="Click here to find out more about our sustainable vases and vase sets with reclaimed wood stands | Reclaim Design"/>
    <meta name="robots" content="index,follow,max-snippet:-1,max-video-preview:-1,max-image-preview:large"/>
    <link rel="canonical" href="https://reclaimdesign.org/vases-reclaimed-wood-stands.html" />
    <meta property="og:locale" content="en_GB">
    <meta property="og:type" content="article">
    <meta property="og:title" content="4 Glamorous Sustainable Vases – Home Decor | Reclaim Design">
    <meta property="og:description" content="Click here to find out more about our sustainable vases and vase sets with reclaimed wood stands | Reclaim Design">
    <meta property="og:url" content="https://reclaimdesign.org/vases-reclaimed-wood-stands.html">
    <meta property="og:site_name" content="Reclaim Design">
    <meta property="article:publisher" content="https://www.facebook.com/reclaimdesignza">
    <meta property="article:author" content="https://www.facebook.com/reclaimdesignza">
    <meta property="og:updated_time" content="2020-02-12T20:12:40+02:00">
    <meta property="fb:app_id" content="722768544475069">
    <meta property="og:image" content="https://reclaimdesign.org/wp-content/uploads/reclaim-design-og-vases.jpg">
    <meta property="og:image:secure_url" content="https://reclaimdesign.org/wp-content/uploads/reclaim-design-og-vases.jpg">
    <meta property="og:image:width" content="1200">
    <meta property="og:image:height" content="630">
    <meta property="og:image:alt" content="Test Tube Vases With Reclaimed Wood Stand | Reclaim Design">
    <meta property="og:image:type" content="image/jpeg">
    <meta name="twitter:card" content="summary_large_image">
    <meta name="twitter:title" content="4 Glamorous Sustainable Vases – Home Decor | Reclaim Design">
    <meta name="twitter:description" content="Click here to find out more about our sustainable vases and vase sets with reclaimed wood stands | Reclaim Design">
    <meta name="twitter:site" content="@ReclaimDesignZA">
    <meta name="twitter:creator" content="@ReclaimDesignZA">
    <meta name="twitter:image" content="https://reclaimdesign.org/wp-content/uploads/test-tube-vases-sustainable-reclaimed-wood-stand1.jpg">
    <script type="application/ld+json">{"@context":"https:\/\/schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"item":{"@id":"https:\/\/reclaimdesign.org","name":"Home"}},{"@type":"ListItem","position":2,"item":{"@id":"https:\/\/reclaimdesign.org\/vases-reclaimed-wood-stands.html","name":"Vases"}}]}</script>
    <!-- /Rank Math WordPress SEO plugin -->

    The breadcrumb scriptis at the end of that. My markup (which validates without errors as a code snippet in the structured data testing tool) is coming in at line 120:

    <script type="application/ld+json">
    {
      "@context": "http://schema.org",
      "@type": "Product",
      "brand": "Reclaim Design",
      "logo": "https://reclaimdesign.org/wp-content/uploads/reclaim-design-logo.jpg",
      "name": "Vases - Sustainable - Home Decor | Reclaim Design",
      "image": [   "https://reclaimdesign.org/wp-content/uploads/test-tube-vases-sustainable-reclaimed-wood-stand1.jpg",    
    "https://reclaimdesign.org/wp-content/uploads/test-tube-vases-sustainable-reclaimed-wood-stand5.jpg",    
    "https://reclaimdesign.org/wp-content/uploads/bottle-vases-sustainable-reclaimed-wood-stand1.jpg",    
    "https://reclaimdesign.org/wp-content/uploads/recycled-gin-bottle-vase-sustainable-reclaimed-wood-stand.jpg"
       ],
      "url": "https://reclaimdesign.org/vases-reclaimed-wood-stands.html",
      "@id": "https://reclaimdesign.org/vases-reclaimed-wood-stands.html",
      "potentialAction": {
        "@type": "SearchAction",
        "target": "https://www.reclaimdesign.org/search?q={search_term_string}",
        "query-input": "required name=search_term_string"
      },
      "sameAs":
    ["https://www.facebook.com/reclaimdesignza",
    "https://twitter.com/ReclaimDesignZA",
    "https://www.instagram.com/reclaimdesign"
    ],
      "description": "Click here to find out more about our sustainable vases and vase sets with reclaimed wood stands | Reclaim Design",
      "offers": [{
        "@type": "Offer",
    	"availability": "http://schema.org/InStock",
    	"price": "390",
        "priceCurrency": "ZAR",
        "url": "https://reclaimdesign.org/home-decor-shop.html/Test-Tube-Vases-With-Stand-p134947241"
      },{
      	"@type": "Offer",
    	"availability": "http://schema.org/InStock",
    	"price": "290",
        "priceCurrency": "ZAR",
        "url": "https://reclaimdesign.org/home-decor-shop.html/Test-Tube-Vases-With-Stand-p134947241"
      },{
      	"@type": "Offer",
    	"availability": "http://schema.org/InStock",
    	"price": "370",
        "priceCurrency": "ZAR",
        "url": "https://reclaimdesign.org/home-decor-shop.html/Bottle-Vases-with-Stand-p65343612"
      },{
      	"@type": "Offer",
    	"availability": "http://schema.org/InStock",
    	"price": "250",
        "priceCurrency": "ZAR",
        "url": "https://reclaimdesign.org/vases-reclaimed-wood-stands.html"
      },{
      	"@type": "Offer",
    	"availability": "http://schema.org/InStock",
    	"price": "300",
        "priceCurrency": "ZAR",
        "url": "https://reclaimdesign.org/home-decor-shop.html/Floating-Globe-Vase-With-Stand-p65346003"
      }]
    }
    </script>

    When I then run the page url through the Structured Data Validation tool, it shows the product schema has somehow been incorporated into the breadcrumb list type, which makes no sense to me (and I imagine to Google either).

    https://www.dropbox.com/s/7o3e5bnfprqy3pn/structured-data-testing-breadcrumb-list-oddness.jpg?dl=0

    Anyway, as I mentioned, I thought if I could move my markup prior to the breadcrumb script then this might work?

    Also, do you guys have any experience using Yoast (or RankMath), and if so which do you prefer/find most helpful?

    Thanks very much for your help.

    Michael.

    #1164343
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    It’s definitely better to simplify things if possible. For example, if you’re adding your own schema, you should remove any other schema on the page, whether it’s coming from the theme or a plugin. Not sure if it’s possible to turn that option off in Rank Math?

    I don’t believe moving the position of the schema will do anything.

    I’ve played with Rank Math and it’s impressive. I think the decision between them and Yoast is really up to what you’re comfortable using 🙂

    #1164386
    Michael

    Hi Tom,

    Thanks very much for getting back to me. You are right, after messing around on tests I don’t think it makes any difference moving it prior. It was just a thought to try and move forward. There is an option to turn off schema type for the page in RankMath which I did, but it still injects breadcrumb. Anyway, I reckon I’ve got a slightly better handle on things now. It seems very hard to find out any useful information on schema online. Most of what I have read is vague and/or non-applicable. I reckon I am just going to insert the markup myself in each page header and hope for the best! Then on to on-page SEO. Fun times 😉

    #1164678
    Tom
    Lead Developer
    Lead Developer

    Yea, good idea. I’m sure if you ask Rank Math if it’s possible to disable the breadcrumbs they’ll be able to help 🙂

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.