Skip to content

Commit 5908ac4

Browse files
Add Yoast Performance Enhancements feature
1 parent 0080d05 commit 5908ac4

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?php
2+
/**
3+
* Class file for Disable_Yoast_Indexables.
4+
*
5+
* (c) Alley <[email protected]>
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+
}

src/alley/wp/alleyvate/load.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff 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();

0 commit comments

Comments
 (0)