Home Forums Support PHP Help

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

    Hi guys,

    This question has nothing to do with the theme, but I am really stuck and am unable to find assistance elsewhere online. I would be extremely glad if you could case your eye over this and point me in the right direction. My PHP skills are non-existent.

    The issue is – I am using the RankMath plugin and it is causing duplicate og, meta, schema and canonical data to be inserted onto the product pages generated by the Ecwid shopping cart plugin (which results in Google ignoring all of it). I have spent much time going back and forward with RankMath who finally got back to me with a code snippet which they say will remove the duplicate data:

    add_action( 'wp_head', function(){
    	if( is_singular('enter_product_post_type_name_here')) {
    		remove_all_actions( 'rank_math/head' );
    		add_action( 'wp_head', '_wp_render_title_tag', 2 );
    	}
    }, 1 );

    All well and good, but they have not explained how I am to find the product_post_type_name they are expecting to be passed in. Is this something I could find from doing a view source on one of the product pages? I really have no idea what to look for (and have asked RankMath but radio silence). I have written to Ecwid but am still awaiting a reply, so in the meantime I am trying to find out myself. I’m also not sure if the code itself is formatted correctly since looking at the GeneratePress snippets for comparison they include ‘?>’ and ‘<?php’

    I’m sorry to bother you with this, but I don’t know who else to ask and I have tried for the last few days to sort it out myself without success. If you are able to help that would be massively appreciated.

    #1174521
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    I’m afraid we’re not familiar with the plugins, so it’s hard to give an answer.

    If you can view the list of posts in the post type in your Dashboard, you should see the post type name inside the URL.

    #1174551
    Michael

    Thanks Tom, I will try that

    #1174766
    Tom
    Lead Developer
    Lead Developer

    No problem 🙂

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