WordPress.org

Ready to get started?Download WordPress

Forums

Add Meta Tags
5 stars, but i have a but (everyone has, init?).. (5 posts)

5 stars
  1. burnbaby
    Member
    Posted 1 year ago #

    tried unticking first option in settings:

    Automatic Basic Metadata
    Automatically generate the description meta tag for single posts, pages, category-based archives and tag-based archives. If this is unchecked, you can still set a description meta tag by using the description custom field. [...]

    why untick:
    to let SEO plugin (Michael Torbert's 'All in One SEO Pack') handle it

    problem:
    comes back on after Save

    leads to:
    doubling meta description tag (with worst case being two different contents, probably confusing SEs)

    can you please elucidate? :)

    thx!

  2. George Notaras
    Member
    Plugin Author

    Posted 1 year ago #

    Thank you for your review!

    This bug affected all settings which were managed by a checkbox and whose default value was 'checked'. It has been fixed in the upcoming 2.3.0 release.

    Kind Regards,
    George

  3. burnbaby
    Member
    Posted 1 year ago #

    http://www.codetrax.org/projects/wp-add-meta-tags/files

    thank you very much for quickly responding :)

    checked your repository, i assume you're (still) working on 2.3.0, so i'll wait till update's being offered by WP's update function, right?

    Thx again!

    PS: don't use Paypal - any other option?

  4. The Nutz
    Member
    Posted 10 months ago #

    I modified a little bit your code because some posts from my webpage are created automatically and contain just photos. So i need the og:image meta tag to find these images and add them automatically.

    I will share this code for those who need this function.

    // Image
            if (function_exists('has_post_thumbnail') && has_post_thumbnail()) {
                $thumbnail_info = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'thumbnail' );
                $metadata_arr[] = '<meta property="og:image" content="' . $thumbnail_info[0] . '" />';
                //$metadata_arr[] = '<meta property="og:image:secure_url" content="' . str_replace('http:', 'https:', $thumbnail_info[0]) . '" />';
                $metadata_arr[] = '<meta property="og:image:width" content="' . $thumbnail_info[1] . '" />';
                $metadata_arr[] = '<meta property="og:image:height" content="' . $thumbnail_info[2] . '" />';
            }
    			else {
    				global $post, $posts;
    				$first_img = '';
    				ob_start();
    				ob_end_clean();
    				$output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $post->post_content, $matches);
    				$first_img = $matches [1] [0];
    
    					if(empty($first_img)){
    					$metadata_arr[] = '<meta property="og:image" content="' . trim($options["default_image_url"]) . '" />';
    					}else {
    					$metadata_arr[] = '<meta property="og:image" content="' . $first_img . '" />';
    						}
    			}
    		if ( is_attachment() && wp_attachment_is_image($post->ID) ) { // is attachment page and contains an image
                $attachment_image_info = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'large' );
                $metadata_arr[] = '<meta property="og:image" content="' . $attachment_image_info[0] . '" />';
                //$metadata_arr[] = '<meta property="og:image:secure_url" content="' . str_replace('http:', 'https:', $attachment_image_info[0]) . '" />';
                $metadata_arr[] = '<meta property="og:image:width" content="' . $attachment_image_info[1] . '" />';
                $metadata_arr[] = '<meta property="og:image:height" content="' . $attachment_image_info[2] . '" />';
            }
  5. George Notaras
    Member
    Plugin Author

    Posted 9 months ago #

    Thanks all for your contributions. It has been fixed in 2.3.0.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.