File tree Expand file tree Collapse file tree 2 files changed +38
-0
lines changed Expand file tree Collapse file tree 2 files changed +38
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+ /**
3+ * Class file for Disable_Yoast_Indexables.
4+ *
5+ 6+ *
7+ * For the full copyright and license information, please view the LICENSE
8+ * file that was distributed with this source code.
9+ *
10+ * @package wp-alleyvate
11+ */
12+
13+ declare (strict_types=1 );
14+
15+ namespace Alley \WP \Alleyvate \Features ;
16+
17+ use Alley \WP \Types \Feature ;
18+
19+ /**
20+ * Performance enhancements for Yoast SEO.
21+ */
22+ final class Yoast_Performance_Enhancements implements Feature {
23+ /**
24+ * Boot the feature.
25+ */
26+ public function boot (): void {
27+ // Disable the Yoast Indexables feature.
28+ add_filter ( 'Yoast\WP\SEO\should_index_indexables ' , '__return_false ' );
29+
30+ // Disable the Yoast SEO Premium Prominent Words feature.
31+ add_filter ( 'Yoast\WP\SEO\prominent_words_post_types ' , '__return_empty_array ' );
32+ add_filter ( 'Yoast\WP\SEO\prominent_words_taxonomies ' , '__return_empty_array ' );
33+ }
34+ }
Original file line number Diff line number Diff line change @@ -125,6 +125,10 @@ function load(): void {
125125 'twitter_embeds ' ,
126126 new Features \Twitter_Embeds (),
127127 ),
128+ new Feature (
129+ 'yoast_performance_enhancements ' ,
130+ new Features \Yoast_Performance_Enhancements (),
131+ ),
128132 );
129133
130134 $ plugin ->boot ();
You can’t perform that action at this time.
0 commit comments