I currently have a Wordpress website using Squirrly for SEO. However, on archive pages, it is using descriptions/titles from the first content page that belongs to the archive page.
So for example, on my accommodation archive page, that lists all the hotels, the title is "Hotel 1", and the description is "Hotel 1 is a beautiful...". They should instead be referencing the title "List of Accommodation", and description "These are all the hotels...".
I am trying to write an over-ride for this - I did find one for Yoast SEO listed here - https://wordpress.stackexchange.com/questions/61472/using-php-to-overwrite-or-replace-title-tag-while-using-yoast/61523#61523?newreg=a3496de25de941a7bb16089b1912653b but this is not working, assumedly because wpseo_title is a filter specific to Yoast.
My current code is:
<?php get_header();
if ( is_archive() ) {
add_filter('wpseo_metadesc', 'filter_product_wpseo_metadesc');
function filter_product_wpseo_metadesc($wpseo_metadesc) {
if( is_singular( 'product') ) {
$wpseo_metadesc = "This is a big test of stuff";
}
return $wpseo_metadesc;
}
} ?>
Does anyone know a filter, or similar, that would over-ride the SEO for my archive pages, either specific to Squirrly SEO, or one which would work in general?