• Resolved herbertwest1

    (@herbertwest1)


    Here is something interesting

    For the past few days I was getting frustrated : i have been trying to optimize my twitter cards and use the “Default Card Type” as “Summary with large image”.
    Not just “Summary”.

    Actually, I don’t even understand why “with large image” is not the default option, but… anyway.

    I would not understand why the change of Twitter Card wasnt happening : I made sure to clear my caches etc… and now I have finally understood.
    Creating a new article uses the new twitter card.

    However, I have pretty much always been duplicating articles to create new ones.
    Duplicating previous articles, and then editing the new ones in order to simplify my content creation. And I realise that, THIS WAY, the twitter card seems to be the old format.

    Apparently I use an old plugin that has now been bought by Yoast : Yoast Duplicate Post
    Any chances for AIO to take a look at why DUPLICATING a post do not take the actual settings for the Twitter cards?

    Thanks !

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author arnaudbroes

    (@arnaudbroes)

    Hey @herbertwest1,

    First of all, we agree that it should be the large image by default for new users. We were already planning on changing this in a future update, probably 4.2.3.

    With regard to Yoast Duplicate Plugin, we integrate with it and it should duplicate your SEO/social meta settings automatically. I just tried and confirmed this on my own test site. Are you using the “Clone” option and using a recent version of AIOSEO?

    Thread Starter herbertwest1

    (@herbertwest1)

    Thanks @arnaudbroes for the reply.

    Good news about the upcoming default option, that would be great.
    If the cloning functions for me ??

    I use uptodate versions of AIOSEO, so i just updated to the latest : 4.2.2, but its still the same for me : if i create a new article it’s the summary with large picture.
    If I “duplicate” an article, it’s still “summary”

    In case that it’s useful, here is an article of the url/used by the plugin to duplicate : /wp-admin/admin.php?action=duplicate_post_new_draft&post=48397&_wpnonce=2059dc624d

    Any ideas?

    Plugin Author arnaudbroes

    (@arnaudbroes)

    I might have misunderstood previously.

    When you are creating a brand-new article that is unrelated to another one, then the default values for that post will be based on what you’ve selected in the Social Networks settings. I assume you’ve now selected “Summary with large Image” as the Twitter Card size there.

    However, if you are duplicating a page using YDP, then it will also duplicate all the SEO/social meta data you’ve set for the original page. If the original page is set to use “Summary” (based on the old default value), then the cloned instance of the page will also have “Summary” set.

    Is that what is happening here?

    Thread Starter herbertwest1

    (@herbertwest1)

    Yes, I believe that this is what is happening here.

    Because originally my default setting was “summary” (not “summary with large image”), my previous articles have that value associated.
    If I duplicate an article, it will keep this setting, evene if I have another default settings in AIOSEO.

    So I guess that my point is that the default value in AIOSEO is not overriding the previous setting in articles when I duplicate an article

    Does that make sense?

    Plugin Author arnaudbroes

    (@arnaudbroes)

    That makes sense, but that’s the intended behaviour though. If you duplicate a page, you duplicate all existing AIOSEO data as well.

    Thread Starter herbertwest1

    (@herbertwest1)

    Maybe from a certain point of view, but not from mine.

    Another way to look at it then, would be : is there a way an option, something to change the default setting from all past articles?
    Because that’s what I intend to do. And therefore duplicating will go back to to the new setting

    Plugin Author arnaudbroes

    (@arnaudbroes)

    @herbertwest1 that depends. There are three options in the metabox:

    1. Default (Set under Social Networks > Twitter)
    2. Summary
    3. Summary with Large Image

    If those posts are using the “Default” value, then they should automatically switch to “Summary with Large Image” if you change the default setting under Social Networks > Twitter.

    However, if that’s not the case and they are specifically set to “Summary”, then there’s no easy way to do this.

    Our team can however write a code snippet for you that just have to run once on your website (e.g. by putting it in your theme’s functions.php file and just loading some random page) that runs a database query to change the value for all of your posts.

    Let me know if that is something you’d like.

    Thread Starter herbertwest1

    (@herbertwest1)

    Yep @arnaudbroes, I looked at the previous articles.
    In the past, they were set as “summary” and not as “default” (set under social networks > twitter)

    And a little while ago, I changed the value because I wanted to move to “Summary with large image”

    So ok, I understand. But yes, it could be interesting (for me as well as other AIOSEO users) to have an option allowing to go edit the value of all the previous articles and therefore actually changing the default

    • This reply was modified 2 years, 8 months ago by herbertwest1.
    Thread Starter herbertwest1

    (@herbertwest1)

    Hello @arnaudbroes ,

    Following up with your previous suggestion of :
    “Our team can however write a code snippet for you that just have to run once on your website (e.g. by putting it in your theme’s functions.php file and just loading some random page) that runs a database query to change the value for all of your posts.”

    I am still interested in that ??

    Plugin Author arnaudbroes

    (@arnaudbroes)

    Hey @herbertwest1,

    You can use the code snippet below –

    add_filter( 'admin_init', 'aioseo_update_twitter_card_value' );
    
    function aioseo_update_twitter_card_value() {
    	global $wpdb;
    
    	$tableName = $wpdb->prefix . 'aioseo_posts';
    	$wpdb->query( "UPDATE ${tableName} SET twitter_card = 'default'" );
    }

    If you’re unsure how to run this code snippet on your site, then I would recommend you to use the WP Code plugin – https://nl.www.ads-software.com/plugins/code-snippets/

    Once you’ve installed that plugin, create a new snippet like this and make sure it’s active – https://prnt.sc/GhfhlMcxeeLT

    Then, reload the page and simply deactivate the snippet again.

    Before you do any of this, I highly recommend you to create a backup so that you can restore your data if anything goes wrong.

    Thread Starter herbertwest1

    (@herbertwest1)

    Thanks @arnaudbroes !

    Sorry for the late reply, I didnt get any email notifications and didn’t see I got a reply…

    Thanks for the code snippet, it worked correctly
    Seems like all my new articles / old / duplicating old articles now all have the right value :
    name=”twitter:card” content=”summary_large_image”

    So that’s a good thing done… I still don’t know why when sharing a link on Twitter, it doesn’t show as a “Summary Card with Large Image”, but I will investigate further

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Twitter card not changed, with duplicate posts’ is closed to new replies.