Skip to content

Commit 13660ea

Browse files
Merge pull request #149 from alleyinteractive/feature/issue-143/disable-yoast-indexables-performance
Issue-143: [FEATURE]: Disable Yoast Indexables functionality
2 parents d86b294 + bb78db8 commit 13660ea

File tree

4 files changed

+43
-0
lines changed

4 files changed

+43
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ This library adheres to [Semantic Versioning](https://semver.org/) and [Keep a C
66

77
### Added
88

9+
* `yoast_performance_enhancements`: Disables Yoast SEO Indexables. Disables Yoast SEO Premium Prominent Words.
910
* `disable_alley_authors`: Changes the author name for anyone with an Alley email address to `Staff`.
1011
* Added the ability to restrict features to specific environments with `alleyvate_load_{$this->handle}_in_environment` where the dynamic portion of the hook name is the feature's handle.
1112

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,10 @@ By default, Alleyvate hooks into this filter to provide one additional attempt a
173173

174174
If one doesn't have a proxy service, one suggestion would be to hook into this filter to enqueue a cron task that makes many (e.g. up to 100) rapid-fire requests to twitter until a successful response comes back. In experimenting with the Twitter oEmbed endpoint, we've found that it both works and fails in spurts, and if we make 100 requests in a loop, we eventually get a 200 response.
175175

176+
### `yoast_performance_enhancements`
177+
178+
Adds a feature to improve Yoast SEO and Yoast SEO Premium performance. Disables the Yoast SEO Indexables feature. Disables the Yoast SEO Premium Prominent words feature.
179+
176180
## About
177181

178182
### License
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)