How to over-ride meta data in Wordpress using Squirrly SEO

0 votes

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?

Feb 28, 2022 in Digital Marketing by Kichu
• 19,050 points
842 views

1 answer to this question.

0 votes
if (is_archive()){

add_filter('sq_title', '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;
    }
}  get_header();
use this 
you can also change the title and description in Squirrly by calling the filters: sq_title and sq_description
answered Mar 1, 2022 by narikkadan
• 63,680 points

Related Questions In Digital Marketing

0 votes
0 answers

How to over-ride meta data in Wordpress, using Squirrly SEO

I currently have a Wordpress website using ...READ MORE

Mar 4, 2022 in Digital Marketing by Kichu
• 19,050 points
550 views
0 votes
0 answers

Wordpress Plug-ins: How-to add custom SEO friendly URL Handles

I was wondering if its possible to ...READ MORE

Mar 5, 2022 in Digital Marketing by Kichu
• 19,050 points
600 views
0 votes
0 answers

Wordpress All In One SEO plugin not sharing to Facebook wall

I use to implement Facebook's OpenGRaph protocol ...READ MORE

Mar 12, 2022 in Digital Marketing by Kichu
• 19,050 points
1,362 views
0 votes
1 answer

The uploaded file exceeds the upload_max_filesize directive in php.ini error while uploading plugin

After looking at your ERROR, it seems ...READ MORE

answered Feb 8, 2022 in Others by Soham
• 9,710 points
671 views
0 votes
0 answers
0 votes
1 answer
0 votes
1 answer

How to Access Yoast SEO tags in Wordpress API Callback

use rest api to request for the ...READ MORE

answered Feb 12, 2022 in Others by narikkadan
• 63,680 points
1,809 views
0 votes
1 answer

How to remove home page title in Yoast SEO?

Here, you have two possibilities. You can ...READ MORE

answered Mar 4, 2022 in Digital Marketing by narikkadan
• 63,680 points
3,017 views
0 votes
1 answer

How to get Stack Overflow SEO friendly URL structure in Nuxt.js?

The following worked for me : To get ...READ MORE

answered Mar 11, 2022 in Digital Marketing by narikkadan
• 63,680 points
1,768 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP