Tag Info

Hot answers tagged

12

It didn't say in the API docs on the Yoast SEO plugin site what the ID was and I don't have a copy of Yoast at installed at disposal, but according to yoas-plugin-dir/admin/class-metabox.php line 144, the meta_box registered is; add_meta_box( 'wpseo_meta', ...etc ); ... Which is hooked onto add_meta_boxes hook on line 32 of the same file, add_action( ...


9

For reference the file that handles the tracking and usage statistics for Yoast SEO is located at, path/to/wp-content/plugins/wordpress-seo/admin/class-tracking.php I have linked to the GitHub repository file in question for further inspection upon which you can see somewhat, relatively, harmless collection of data. However what you determine as ...


7

On remove_meta_box is a note: Because you can't remove a meta box until it's been added, it's important to make sure your call to remove_meta_box() happens in the right sequence. WordPress SEO adds meta boxes on add_meta_boxes action with default priority - 10, which run after admin_init, so that won't remove them. Instead you need to hook into ...


5

Get Archive SEO titles If you defined a Custom Post Type archive title you can get that by: $titles = get_option( 'wpseo_titles' ); $title = $titles['title-ptarchive-POST_TYPE']; echo apply_filters( 'the_title', $title ); Remember to replace POST_TYPE by your own Custom Post Type. To display all the wpseo_title variables, you can use: printf( ...


4

You can remove it using the remove_meta_box function. if ( ! current_user_can( 'edit_pages' ) ) { add_action( 'add_meta_boxes', 'my_remove_wp_seo_meta_box', 100000 ); } function my_remove_wp_seo_meta_box() { remove_meta_box( 'wpseo_meta', 'post', 'normal' ); } Notice the 100000 in the add_action, this makes sure that this is done after the WP SEO ...


4

Unless the plugin has made significant database changes, you could follow these steps to downgrade it: Download and extract the old version from the plugin repository Disable the plugin Log on to your server with FTP or SSH Upload the old plugin directory to wp-content/plugins/. (You would want to overwrite the newer version.) Reactivate the plugin ...


4

You have introduced 2 additional problems by adding the jQuery from Google CDN. The admin interface needs jQuery called in no conflict mode so it won't interfere with the other scripts WordPress uses for the dashboard. The WordPress dashboard is not yet compatible with jQuery 1.5 thats why it was pulled from trunk right before 3.1 was released. See: ...


4

ASCII characters will not cause any issues with search engines and they will be displayed properly. SEOmoz does this to avoid any chance of sql injection via its form fields.


3

Throw this into your functions.php: function clear_yoast_metadesc( $metadesc ) { return ''; } add_filter( 'wpseo_metadesc', 'clear_yoast_metadesc', 99, 1 ); If you set the $metadesc to empty like that, it won't be echoed. BTW, bulk editing is very hard on my to-do list, so you would be able to switch back completely :)


3

In the source code I see two og:description meta tags. The first and correct one seems to be coming from your Yoast WordPress SEO Plugin. The other one is outside the plugin's block, so I guess it's defined elsewhere. Check your theme if it includes that meta tag. If not, check your other plugins. Disable them one by one to find the culprit.


3

You will want to make use of Yoast SEO's "WPSEO_Frontend" class. To display the meta description field content, you could do the following: <?php if (class_exists('WPSEO_Frontend')) { echo WPSEO_Frontend::metadesc(false); } ?>


3

Solution: <?php $object = new WPSEO_Frontend(); echo $object->metadesc( false ); ?>


3

Try pasting this in a plugin or theme functions.php file, as per the WordPress SEO plugin (API Docs), by Yoast. if(function_exists('wpseo_use_page_analysis') && !current_user_can('administrator')){ add_filter('wpseo_use_page_analysis', '__return_false'); } To avoid any errors... This checks to make sure the function exists, before attempting ...


3

Yoast uses wp_head hook to output the meta description tag. Make sure you have this line in your <head>: <?php wp_head(); ?> For title tag, you can simplify the code by using one function call: <?php wp_title( '|', true, 'right' ); ?> The wp_title uses a filter (same name wp_title) to let users change the title tag. And Yoast uses ...


3

The WPSEO plugin by Yoast has a filter for the title: 'wpseo_title'. You'll need to add something like this: add_filter('wpseo_title', 'filter_product_wpseo_title'); function filter_product_wpseo_title($title) { if( is_singular( 'product') ) { $title = //your code } return $title; }


3

I don't think you are going to be able to do that using remove_action. The function argument in remove_action will not help you as the debug_marker() function was not the function that was used in the add_action() call. Yoast presumably has something like add_action( "wp_head", "head" ) in his code. So you can remove the "head" function but debug_marker was ...


3

Looking at the filter: $post_content = apply_filters( 'wpseo_pre_analysis_post_content', $post->post_content, $post ); it would be a matter of adding your fields content to string being analyzed. You have to do the get_field() part right, this is untested: add_filter( 'wpseo_pre_analysis_post_content', 'filter_yoasts_wpse_119879', 10, 2 ); function ...


2

Here's the general principle of what you need to do: Hook into the wpseo_breadcrumb_links or wp_seo_get_bc_ancestors API filters. Add your Blog into the WordPress SEO Breadcrumb $links array, using array_splice. Place this in your theme's functions.php: /** * Conditionally Override Yoast SEO Breadcrumb Trail * ...


2

You can use the filter wpseo_submenu_pages for that. The plugin provides an array of all used submenupages, and lists the capability someone needs to access the certain page. The Submenupageitem wpseo_bulk-title-editor has the values (for example): [7] => Array ( [0] => wpseo_dashboard //parentmenupage [1] => Yoast WordPress ...


2

There is even a better solution: a filter called plugin_locale. It filters the locale argument before using it in load_plugin_textdomain. add_filter( 'plugin_locale', 'mytheme_plugin_locale' ); function mytheme_plugin_locale() { return 'en_US'; }


2

You can use the wpseo_title filter to read the tag for your site title after WPSEO creates it, and if it's not there, add it on. add_filter( 'wpseo_title', 'wpse137502_wpseo_title' ); function wpse137502_wpseo_title( $title ) { $site_title = get_bloginfo( 'name' ); if ( ! strpos( $title, $site_title ) ) { $title .= " | " . $site_title; ...


2

This is possible using the filter wpseo_breadcrumb_links. In this example, I'm using the functions bp_get_user_meta and bp_loggedin_user_id, adjust as needed. To check if the page is child of the Members page (in this example, ID == 2), I'm using the function has_parent grabbed from here. add_filter( 'wpseo_breadcrumb_links', 'buddy_crumbs_wpse_88889' ); ...


2

It appears that your site doesn't use the core WordPress Featured Image feature but instead uses a custom image field (probably from Advanced Custom Fields). Yoast's plugin, Jetpack, and presumably many others look for the Featured Image image when setting the opengraph meta tag. So you have two options: Use the core Featured Image feature with one of the ...


2

A simple way to achieve this (but without the Class approach) is by filtering the output of wp_head action hook using the output buffering. In your theme's header.php, wrap the wp_head() call with ob_start($cb) and ob_end_flush(); functions like: ob_start('ad_filter_wp_head_output'); wp_head(); ob_end_flush(); Now in theme functions.php file, declare ...


2

It's called Author Rich Snippets. Your link needs to look like <link href="https://plus.google.com/115911773396772351667?rel=author"/>Your Name</a> The Simple Way To Set Up Author Rich Snippets There are a few things you need in order to step up Author Rich Snippets: A public Google+ profile. Make sure to upload a decent looking profile ...


2

That plugin loads its language the moment its main file is included: load_plugin_textdomain( 'wordpress-seo', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' ); So when your locale filter is used, the language is already there. :/ Move your small plugin into the mu-plugins directory. You can create it if it doesn’t exists in wp-content. That ...


2

It's normal. If you entered a website title in Settings => General, this is the title will be taken into account. WordPress SEO by Yoast SEO plugin doesn't rewrite the title chosen in WordPress by default.


2

Within the pages "Wordpress SEO by Yoast" meta box, open the "Advanced" tab and set the "Meta Robots Index". It took me forever to find this as well.


2

Seriously, I don't know why this thing keeps popping up but: it just works with single quotes, no need to change anything. Need proof? Ok, here we go: Search for "WordPress SEO plugin". Find my site, yoast.com, it'll be #1 in most cases. See the meta description showing? Click on the "Cached" link, then open the source for the cache. There it is, in full ...


2

Edit. Here's another solution to not mess with the edit slug button. The function get_sample_permalink_html in wp_admin/includes/post.php outputs the sample permalink and an edit button. It can be filtered like this: add_filter('get_sample_permalink_html','my_sample_permalink',10,2); function my_sample_permalink ($page_link,$id){ $page = ...



Only top voted, non community-wiki answers of a minimum length are eligible