If a WordPress site doesn't have XML sitemaps, or you can't find them, there are a number of ways to figure out how many tags and posts that site has. The easiest way is by using the REST API to get the number. Note both scripts below are fairly similar and could probably be simplified. Also: please don't run this on sites too aggressively. Not all sites handle getting 100 posts from their REST API endpoints very well.
<?php | |
/* | |
* Plugin Name: Replace og:image .avif to .jpg | |
* Description: Replaces og:image URLs ending in -jpg.avif with .jpg in the page output. Uses the new WP_HTML_Tag_Processor. | |
*/ | |
add_action( 'template_redirect' , function() { | |
ob_start( 'joost_replace_og_avif_with_jpg' ); | |
}); |
This simple playground.yml
creates a comment that opens a WordPress Playground and installs the plugin from the
current repository. The current iteration only works with plugins that do not require a build step.
Because GitHub doesn't send the right CORS headers for zip files to be able to install them in a Playground, you need
a reverse proxy to bypass the CORS restrictions. The Worker below in worker.js
can be used as a Cloudflare worker that
<?php | |
$protocol = 'https'; | |
if ( ! isset( $_SERVER['HTTPS'] ) || $_SERVER['HTTPS'] === 'off' ) { | |
$protocol = 'http'; | |
} | |
$url = $protocol . "://" . $_SERVER['HTTP_HOST']; | |
header( 'Location: ' . $url, true, 301 ); | |
exit; |
<?php | |
add_filter( 'wpseo_schema_website', 'example_change_website_schema', 10, 2 ); | |
/** | |
* Changes the Yoast SEO Website schema. | |
* | |
* @param array $data The Schema Website data. | |
* @param Meta_Tags_Context $context Context value object. | |
* |
<?php | |
/** | |
* Adds Schema pieces to our output. | |
* | |
* @param array $pieces Graph pieces to output. | |
* @param \WPSEO_Schema_Context $context Object with context variables. | |
* | |
* @return array $pieces Graph pieces to output. | |
*/ |
<script type="application/ld+json">{ | |
"@context": "https://schema.org", | |
"@graph": [ | |
{ | |
"@type": "Organization", | |
"@id": "https://example.com/#organization", | |
"name": "Yoast", | |
"url": "https://example.com/", | |
"sameAs": [ | |
"https://www.facebook.com/yoast", |
Regex search:
style=(["|'])fill:#([a-zA-Z0-9]{3,});\1
replace withfill="#$2"
(class|id)=(["|'])([a-zA-Z_0-9-^-]+)\2
replace with blank
In a nuttshell:
- Remove
<title>
and<decoration>
if the image is “just decoration”. - Add
role="img" aria-hidden="true" focusable="false"
to the svg. Excludearia-hidden="true"
if its an infographic. - If its important to understand the “svg” in order to understand what the page is about, use
aria-labelledby="title desc"
on the SVG and useand
element in the SVG.
Yes, we have prevented you from adding new 301 redirects in the advanced tab of the Yoast SEO meta box. And we have a couple of very good reasons for that.
As it was, it was virtually impossible to keep track of what post is redirected where. You’d have to open each post or visit each URL to find out. This was causing quite a mess over time.
Our Yoast SEO Premium customers, who have access to a far better redirects module, often ran into posts that were redirected while no redirect was set in the redirects module. Having to manage redirects in a couple of different locations really is undoable.
Checking for the set 301 redirect also requires us to do an extra query on every pageload. Which means we had to slow your website down a bit, just to check if there was a redirect set. Since speed is gaining importance as a ranking factor, we are constantly looking how we can further optimize our plu