Hello,
To remove that option, please add the following code to the functions.php file of your child theme:
add_filter( 'attachment_fields_to_edit', function( $form_fields, $post ) { unset( $form_fields['rank_math_exclude_sitemap'] ); }, 30, 2 );
If you want this code to apply for users with (or without) specific capabilities, you can do something like this:
add_filter( 'attachment_fields_to_edit', function( $form_fields, $post ) { if ( ! current_user_can( 'install_plugins' ) ) { unset( $form_fields['rank_math_exclude_sitemap'] ); } }, 30, 2 );
With the code above, only users who can install plugins will be able to see the checkbox. You can find a list of the default capabilities here: https://wordpress.org/support/article/roles-and-capabilities/
Hope that helps.
Thanks!
This solution has worked.
Hello,
We are super happy that this resolved your issue. If you have any other questions in the future, know that we are here to help you.
If you don’t mind me asking, could you please leave us a review (if you haven’t already) on https://wordpress.org/support/plugin/seo-by-rank-math/reviews/#new-post about your overall experience with Rank Math? We appreciate your time and patience.
If you do have another question in the future, please feel free to create a new forum topic, and it will be our pleasure to assist you again.
Thank you.