Plugin - Yoast SEO

Plugin - Yoast SEO

Convinient additions

Introducion of custom SEO variables

I am improving new with new SEO variables like {{~}} which contains the most notable value from vouchers.

When changing SEO variable name, use this command:

START TRANSACTION;
UPDATE wp_postmeta
 SET meta_value = REPLACE(meta_value, '%%~%%', '{{~}}')
 WHERE  meta_value LIKE '%%%~%%%';
COMMIT;

Yoast SEO in Custom Types

To at least enable Yoast SEO in a post type make sure you set your post type to 'public' => true.

No meta desc in custom taxonomies

As taxonomies don’t have Excerpt field, they also don’t have automatic SEO meta description. I can use variable in defaults of Yoast, but then description is very long and Google will form that anyway just much more appropriate.

It is working when its manualy entered in SEO metabox in taxonomy itself; just atomatic generation is not working.

Where are variables stored

For posts, meta titles are stored in wp_postmeta, as expected.

SELECT * FROM wp_postmeta WHERE meta_key LIKE '_yoast_wpseo%'
// DELETE FROM wp_postmeta WHERE meta_key LIKE '_yoast_wpseo%'

Interesting metas are: _yoast_wpseo_title and _yoast_wpseo_metadesc

SELECT p.post_type, COUNT(p.post_type)
FROM etkwp_postmeta AS m
JOIN etkwp_posts AS p 
WHERE `meta_key` = '_yoast_wpseo_title' AND p.ID = m.post_id
GROUP BY p.post_type

As for taxonomies, meta titles are stored as option wpseo_taxonomy_meta in wp_options table, as serialized array.

SELECT * FROM etkwp_options WHERE option_name LIKE 'wpseo_%'

Here is how to show, or remove, specific meta titles for post type shop:

SELECT p.post_title, p.post_type, m.meta_value
FROM etkwp_postmeta AS m
JOIN etkwp_posts AS p 
WHERE m.meta_key = '_yoast_wpseo_title' AND p.ID = m.post_id AND p.post_type = 'shop'

Extend Yoast Javascript part

mb-yoast-seo/script.js at master · rilwis/mb-yoast-seo Yoast/YoastSEO.js Yoast SEO: Developer Beta • Yoast Dev Blog The examples in the README.md file are not complete / correct · Issue #181 · Yoast/YoastSEO.js YoastSEO.js/README.md at master · Yoast/YoastSEO.js wordpress-seo/wp-seo-shortcode-plugin.js at 3.0 · Yoast/wordpress-seo YoastSEO.js design decisions • Yoast Dev Blog

date 01. Jan 0001 | modified 28. May 2021
filename: Wordpress Plugin - Yoast SEO