{"id":7887,"date":"2021-02-19T17:06:27","date_gmt":"2021-02-19T16:06:27","guid":{"rendered":"https:\/\/www.welaunch.io\/es\/?p=7887"},"modified":"2024-05-15T11:42:02","modified_gmt":"2024-05-15T09:42:02","slug":"no-index-hidden-woocommerce-products-from-yoast","status":"publish","type":"post","link":"https:\/\/www.welaunch.io\/es\/2021\/02\/no-index-hidden-woocommerce-products-from-yoast\/","title":{"rendered":"No hay \u00edndice oculto de productos WooCommerce de Yoast"},"content":{"rendered":"<p>Los productos de WooCommerce con el estado de visibilidad oculto (excluidos del cat\u00e1logo) siguen siendo indexados por la herramienta Yoast SEO. Para eliminarlos de los sitemaps generados autom\u00e1ticamente y establecer el estado del \u00edndice en &#8220;noindex, nofollow&#8221; a\u00f1ada las siguientes 2 funciones a sus funciones.phpadd_filter( &#8216;wpseo_sitemap_entry&#8217;, &#8216;we_remove_hidden_products&#8217;, 99, 3);function we_remove_hidden_products($url, $type, $post) {si($post->post_type == &#8216;product&#8217; &#038;&#038; is_object_in_term( $post->ID, &#8216;product_visibility&#8217;, &#8216;exclude-from-catalog&#8217;)){devuelve &#8221;;}devolver $url;}add_filter(&#8216;wpseo_robots&#8217;, &#8216;we_noindex_hidden_products&#8217;, 10, 2);function we_noindex_hidden_products($robots, $indexable) {si(!isset($indexable->model)) {devolver $robots;}si(!isset($indexable->model->object_id)) {devolver $robots;}si(is_object_in_term( $indexable->model->object_id, &#8216;product_visibility&#8217;, &#8216;exclude-from-catalog&#8217;)){$robots=&#8217;noindex, nofollow&#8217;;}devolver $robots;}<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Los productos de WooCommerce con el estado de visibilidad oculto (excluidos del cat\u00e1logo) siguen siendo indexados por la herramienta Yoast SEO. Para eliminarlos de los sitemaps generados autom\u00e1ticamente y establecer el estado del \u00edndice en &#8220;noindex, nofollow&#8221; a\u00f1ada las siguientes 2 funciones a sus funciones.phpadd_filter( &#8216;wpseo_sitemap_entry&#8217;, &#8216;we_remove_hidden_products&#8217;, 99, 3);function we_remove_hidden_products($url, $type, $post) {si($post->post_type == &#8216;product&#8217;&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[4],"tags":[],"class_list":["post-7887","post","type-post","status-publish","format-standard","hentry","category-woocommerce"],"_links":{"self":[{"href":"https:\/\/www.welaunch.io\/es\/wp-json\/wp\/v2\/posts\/7887","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.welaunch.io\/es\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.welaunch.io\/es\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.welaunch.io\/es\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.welaunch.io\/es\/wp-json\/wp\/v2\/comments?post=7887"}],"version-history":[{"count":5,"href":"https:\/\/www.welaunch.io\/es\/wp-json\/wp\/v2\/posts\/7887\/revisions"}],"predecessor-version":[{"id":8726,"href":"https:\/\/www.welaunch.io\/es\/wp-json\/wp\/v2\/posts\/7887\/revisions\/8726"}],"wp:attachment":[{"href":"https:\/\/www.welaunch.io\/es\/wp-json\/wp\/v2\/media?parent=7887"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.welaunch.io\/es\/wp-json\/wp\/v2\/categories?post=7887"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.welaunch.io\/es\/wp-json\/wp\/v2\/tags?post=7887"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}