WordPress.org

Ready to get started?Download WordPress

Forums

Add Meta Tags
[resolved] Image Size for Schema and OG (5 posts)

  1. Eric Prindle
    Member
    Posted 11 months ago #

    When I post a link from my blog to Facebook and Google+, only a small thumbnail image displays rather than an image that fills the full width of the post. This appears to be because AMT selects the "medium" version of each image (normally 300 pixels in width) for the og:image and schema ImageObject tags. Reportedly, the minimum width for Facebook to display a full-width image is 560, while the minimum width for Google+ is 506. Is there a way to reference the full-size version of at least the featured image in the og and schema tags?

    https://wordpress.org/plugins/add-meta-tags/

  2. superkaratemonkeydeathcar
    Member
    Posted 8 months ago #

    Hi Eric,
    I was having the same issue myself.

    So I poked around in the plugin files, found a solution & thought I'd share.

    Beforehand though,
    NOTE: This type of Trial+Error also works best if you have a little separate testing-area install of WP on a subdirectory of your server like /newfeaturetests/ or whatever.
    -So you don't screw an important live-site horking around with your core php files, by making some little syntactical or punctuation mistake.
    Just fill it with dummy headers, entries, images, etc. and fool around with no/low consequences.

    Anyway,

    If you go into Plugins>Editor, and look in the files:
    add-meta-tags/metadata/amt_twitter_cards.php
    add-meta-tags/metadata/amt_opengraph.php,

    On Line 510 of the OpenGraph one you should see:
    $size='medium'
    Change medium to the image size that you would like. In mine, I just put full, because mine aren't that big.
    Also, Put a note in the nearest comment area of the php file that you changed something to remind yourself what, when & where.
    Save the changes with "Update File".

    In the file for the Twitter Cards its on Line 137.

    I haven't looked in the Schema one, but a search for the word, 'medium' and then a change to your desired size should give similar results. (upd: It might be the one on Line 410)

    Do the same thing, super-reload the page & see what happens.

    Best of Luck; Cheers.

  3. George Notaras
    Member
    Plugin Author

    Posted 2 months ago #

  4. George Notaras
    Member
    Plugin Author

    Posted 2 months ago #

    Fixed in 2.5.0 which will be out soon.

    Customization of the image size via filters will be possible.

    Thanks for your feedback.

  5. George Notaras
    Member
    Plugin Author

    Posted 2 months ago #

    Please, check out 'Example 5' in the plugin description page for sample code in order to customize the image size used in meta tags.

Reply

You must log in to post.

About this Plugin

About this Topic