{"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":"
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 “noindex, nofollow” a\u00f1ada las siguientes 2 funciones a sus funciones.phpadd_filter( ‘wpseo_sitemap_entry’, ‘we_remove_hidden_products’, 99, 3);function we_remove_hidden_products($url, $type, $post) {si($post->post_type == ‘product’ && is_object_in_term( $post->ID, ‘product_visibility’, ‘exclude-from-catalog’)){devuelve ”;}devolver $url;}add_filter(‘wpseo_robots’, ‘we_noindex_hidden_products’, 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, ‘product_visibility’, ‘exclude-from-catalog’)){$robots=’noindex, nofollow’;}devolver $robots;}<\/p>\n","protected":false},"excerpt":{"rendered":"
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 “noindex, nofollow” a\u00f1ada las siguientes 2 funciones a sus funciones.phpadd_filter( ‘wpseo_sitemap_entry’, ‘we_remove_hidden_products’, 99, 3);function we_remove_hidden_products($url, $type, $post) {si($post->post_type == ‘product’…<\/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}]}}