Title: log
Last modified: February 17, 2024

---

# log

 *  Resolved [vtrn](https://wordpress.org/support/users/vtrn/)
 * (@vtrn)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/log-46/)
 * I have this in my debug log for a long time:
 * `[17-Feb-2024 07:17:34 UTC] PHP Notice: Undefined index: @type in /home/vtrn/
   public_html/wp-content/plugins/seo-by-rank-math/includes/modules/schema/class-
   frontend.php on line 107 [17-Feb-2024 07:17:34 UTC] PHP Notice: Undefined index:@
   type in /home/vtrn/public_html/wp-content/plugins/seo-by-rank-math/includes/modules/
   schema/class-frontend.php on line 180`
 * I applied some customizations to canonical, schema or page titles with using 
   rankmath codes
   Could the problem be from here?

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Support [Rank Math Support](https://wordpress.org/support/users/rankmathsupport/)
 * (@rankmathsupport)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/log-46/#post-17435555)
 * Hello [@vtrn](https://wordpress.org/support/users/vtrn/),
 * Thank you for your query and we are so sorry about the trouble this must have
   caused.
 * The PHP Warning that you are seeing is caused by an invalid schema markup. If
   you have added a custom schema for a particular page, then you can use the bulk
   action to add the default schema on this page and Rank Math will automatically
   remove all other invalid schema from there: [https://rankmath.com/kb/bulk-editing-in-rank-math/#set-schema-markup-to-default-type](https://rankmath.com/kb/bulk-editing-in-rank-math/#set-schema-markup-to-default-type)
   and then, you can add back the correct schema again and see if that resolves 
   the issue.
 * If it doesn’t, let us know here so we can debug this issue further.
 * Looking forward to helping you.
 *  Thread Starter [vtrn](https://wordpress.org/support/users/vtrn/)
 * (@vtrn)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/log-46/#post-17498157)
 * Hi, I found the problem.
   I have disabled the schema of products belonging to 
   a specific category using the following code:
 *     ```wp-block-code
       add_filter( 'rank_math/snippet/rich_snippet_product_entity', function ($data) {
           $term_ids = array();
           $product_cats = wp_get_post_terms(get_the_ID(), 'product_cat');
           foreach ($product_cats as $product_cat) {
               $term_ids[] = $product_cat->term_id;
           }
           $exclude_category_ids = array( 1665, 1668);
           if (array_intersect($exclude_category_ids, $term_ids)) {
               return false;
           }
           return $data;
       } );
       ```
   
 * And when I open a product in these categories
   This error occursHow can I avoid
   this error?
 *  Plugin Support [Rank Math Support](https://wordpress.org/support/users/rankmathsupport/)
 * (@rankmathsupport)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/log-46/#post-17507617)
 * Hello [@vtrn](https://wordpress.org/support/users/vtrn/),
 * That filter is used to modify the Schema data. You shouldn’t use that to remove
   a Schema type completely. Please use the following filter instead:
   `add_filter('
   rank_math/json_ld', function( $data, $jsonld ) { if(is_product()) { $term_ids
   = array(); $product_cats = wp_get_post_terms(get_the_ID(), 'product_cat'); foreach(
   $product_cats as $product_cat) { $term_ids[] = $product_cat->term_id; } $exclude_category_ids
   = array( 1665, 1668,); if (array_intersect($exclude_category_ids, $term_ids)){
   unset($data['richSnippet']); } } return $data; }, 99, 2);`
 *  Hope that helps and please do not hesitate to let us know if you need our assistance
   with anything else.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘log’ is closed to new replies.

 * ![](https://ps.w.org/seo-by-rank-math/assets/icon.svg?rev=3438330)
 * [Rank Math SEO – AI SEO Tools to Dominate SEO Rankings](https://wordpress.org/plugins/seo-by-rank-math/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/seo-by-rank-math/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/seo-by-rank-math/)
 * [Active Topics](https://wordpress.org/support/plugin/seo-by-rank-math/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/seo-by-rank-math/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/seo-by-rank-math/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Rank Math Support](https://wordpress.org/support/users/rankmathsupport/)
 * Last activity: [2 years, 3 months ago](https://wordpress.org/support/topic/log-46/#post-17507617)
 * Status: resolved