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 ...


5

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 ...


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

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

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( ...


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

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

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

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 ...


2

This was caused by a small bug in my first implementation of the rel="next" and rel="prev" features that Google launched 2 weeks ago in my WordPress SEO plugin. That bug has been fixed, you're up to date and the 404's should go away soon enough, nothing to worry about!


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 = ...


2

To add a page number regardless to any plugin … use filters. Do not change the plugin file. You cannot run updates other wise. Example: <?php # -*- coding: utf-8 -*- /** * Plugin Name: T5 Add page number to title * Description: Adds <code> | Page $number</code> to the page title. * License: MIT * License URI: ...


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

what you are looking for is call in the WordPress world a MetaBox and just like Yoast SEO you need to use add_meta_box() function to add your own. there is a great tutorial and class you can use in your plugin at deluxeblogtips.com I would suggest you use that for a starting point.


2

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 ...


2

In order to be indexed by google news you need a unique permalink structure containing a unique number. You seem to have a permalink structure of %postname% that doesn't contain a number. You could change your permalinks for example to %post_id%/%postname% or %post_id%-%postname% in order to comply with google news requirements.


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

It is suppose to work this way. Joost's plugin only gives you a great tool for you to optimize your snippet. If you haven't done any optimizations whatsoever, like creating an awesome brief description of what your content is all about, Google will probably try to figure out what's the best bit of content by their own. Just a minor edit, Google just ...


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

Now I do have quite an aggressive caching turned on with WP Super Cache. Does it still matter if I force-rewrite the titles then? Or in my case it doesn't change a thing since pages are pre-generated and served as static content? Yes it does matter because you are not serving cached content 100% of the time and you also have to think about the ...


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

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

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

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

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 ...


1

Yoast SEO uses capabilities (WordPress docs on roles and capabilities) to determine whether users are allowed to bulk edit tiles and descriptions. The name of the capability used for this is wpseo_bulk_edit. By default, Yoast SEO adds this capability to the administrator, editor, author and contributor roles. To remove this capability from all roles except ...


1

Ho, @hyperdrive - we wrestled with the exact same scenario and need and wrapped our solution / approach in a plugin: http://wordpress.org/plugins/ns-seo-custom-fields/ You can use the standard custom field name(s) from the edit interface or ACF's "Field Name" value, and there's a screenshot to show where to find those exact values: ...



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