Metabox Relationships Rank Math Conflict

Support MB Relationships Metabox Relationships Rank Math ConflictResolved

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #32864
    Michele SchembriMichele Schembri
    Participant

    I recently noticed that Rank Math's sitemap.xml is no longer working on my site. After doing some digging and disabling code in my theme I noticed that whenever I removed the Metabox Relationships declarations the sitemap started working again. An example of the code I am commenting out can be found below:

    <?php
    
    /**
     * MetaBox CPT Relationships Declarations
     *
     * @package Effiliate
     */
    
    // Exit if accessed directly.
    defined('ABSPATH') || exit;
    
    add_action( 'mb_relationships_init', function() {
        MB_Relationships_API::register( [
            'id'   => 'operator_to_game',
            'from' => 'operator',
            'to'   => 'game',
        ] );
    
        MB_Relationships_API::register( [
            'id'   => 'operator_to_payment',
            'from' => 'operator',
            'to'   => 'payment',
        ] );
    
        MB_Relationships_API::register( [
            'id'   => 'operator_to_bonus',
            'from' => 'operator',
            'to'   => 'bonus',
        ] );
    
        MB_Relationships_API::register( [
            'id'   => 'operator_to_regulator',
            'from' => 'operator',
            'to'   => 'regulator',
        ] );
    } );

    I also have the mb-rankmath installed however it seems that this does not make any difference.

    #32870
    Long NguyenLong Nguyen
    Moderator

    Hi Michele,

    Thanks for your feedback.

    I'm going to check this issue and get back to you later.

    #32878
    Long NguyenLong Nguyen
    Moderator

    Hi,

    I do not see that issue on my end, screen record https://share.getcloudapp.com/7KuqgK0Z

    The sitemap still works as well.

    #32885
    Michele SchembriMichele Schembri
    Participant

    Hi,

    thanks for looking into this. I found the issue. I had an extra newline before the first <?php which was causing this issue. I understand that this was not Meta Box related and apologies for wasting any of your time. Thanks and apologies once again.

    #32890
    Long NguyenLong Nguyen
    Moderator

    No worries. Let me know if you have any questions.

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