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 in Digital Marketing by Kichu
• 17,220 points
39 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 by narikkadan
• 7,860 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 in Digital Marketing by Kichu
• 17,220 points
14 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 in Digital Marketing by Kichu
• 17,220 points
37 views
0 votes
0 answers

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

Stack Overflow has the following URL structure ...READ MORE

Mar 10 in Digital Marketing by Kichu
• 17,220 points
136 views
0 votes
1 answer
0 votes
0 answers
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 in Others by narikkadan
• 7,860 points
55 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 in Digital Marketing by narikkadan
• 7,860 points
93 views
0 votes
1 answer

Wordpress SEO : Semrush audit report

actually autoptimize, and Wp Rocket are the ...READ MORE

answered Mar 1 in Digital Marketing by narikkadan
• 7,860 points
31 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP