osompress / genesis-simple-share

Plugin: Genesis Simple Share
36 stars 16 forks source link

Use alt text for Pinterest description instead of post title #55

Closed nickcernis closed 9 years ago

nickcernis commented 9 years ago

The official Pinterest “Pin It” button (Chrome) pulls the Pinterest description from image alt text:

post_in_category_13_-_test_site

Genesis Simple Share currently uses the post title for the Pinterest description instead:

pinterest__discover_and_save_creative_ideas_and_post_in_category_13_-_test_site

The post I'm testing this with is at http://nick-cernis.preview76.rmkr.net/post-category-13/.

User expectation is that the Pinterest description should come from image alt text if it's set, rather than from the post title.

Using alt text for the title is also recommended in this post from the Copyblogger blog:

When you upload images and embed them in your online content, pay special attention to the “Alt Text” for each image. Pinterest automatically reads “Alt” data when a Pinterest user pins your image — so whatever you enter as the “Alt Text” for a particular image becomes the default pin description for that image.

Pinterest’s Guided Search looks at pin descriptions to decide which pins are relevant (and which are not) to show in user searches, so it’s critical to make the “Alt text” for every image keyword rich.

Perhaps Simple Share should also use alt text when available when sharing via Pinterest, just as the official Pinterest button does, then fall back on the post title if no alt text is available?

NicktheGeek commented 9 years ago

The share on pinterest button is effectively sharing the post and using the featured image. There isn't really alt text to pull from in the featured image. The script isn't scanning the page to find an image and share that. There are other plugins for pinning images which would be more appropriate to that usage.

nickcernis commented 9 years ago

There isn't really alt text to pull from in the featured image.

I think something like this might work:

$thumb_id = get_post_thumbnail_id( $post->ID );
$alt_text = get_post_meta( $thumb_id, '_wp_attachment_image_alt', true );

If no alt text is set for the image, $alt_text will be empty.

I agree with you that reproducing the entire functionality of the official Pinterest button to scan the page for images with JS might be overkill. I just wanted to report that customers find the existing GSS Pinterest share behaviour frustrating, because they're used to other Pinterest share buttons pulling in the alt text instead of the title. Right now, they have no way to set a custom description other than editing the post title.

Other (non-official) implementations of share buttons automate the use of alt text by linking to pin/find/ instead of pin/create/, which seems to give a sharing experience that's closer to the native Pinterest one.

e.g. Try clicking the Pinterest badge in this article:

Is that worth considering as a workaround?

pinterest-share