Update CPT TO NO-INDEX YOAST
JavaScript
?php /** * One-time script: Set noindex for all posts with slug "veelgestelde-vragen" * Run once via WPCodeBox, then disable or delete the snippet. */ if ( ! defined( 'ABSPATH' ) ) // Get all posts with the exact slug "veelgestelde-vragen" $posts = get_posts( array( 'post_name' => 'veelgestelde-vragen', // exact slug 'post_type' => 'any', // includes posts, pages, CPTs, etc. 'posts_per_page' => -1, // get all 'fields' => 'ids', // only return IDs for performance ) ); if ( empty( $posts ) ) $count = 0; foreach ( $posts as $post_id ) // Optional: clear Yoast indexables cache so changes take effect faster if ( function_exists( 'YoastSEO' ) ) echo ' <p data-etch-context="eyJyZWYiOiJoZzVyenNqIn0=">✅ Done! ' . $count . ' post(s) with slug "veelgestelde-vragen" have been set to <strong data-etch-context="eyJyZWYiOiJhbHBneW84In0=">noindex</strong> in Yoast SEO. </p>';</code>