Remove an action from an external Class

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 your output callback function (ad_filter_wp_head_output in this case): … Read more

WordPress SEO by Yoast: Hide Meta Boxes in Posts for Non-admins

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 … Read more

How to add a page to the Yoast breadcrumbs

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 * http://plugins.svn.wordpress.org/wordpress-seo/trunk/frontend/class-breadcrumbs.php * ———————————————————————————– */ add_filter( ‘wpseo_breadcrumb_links’, ‘wpse_100012_override_yoast_breadcrumb_trail’ ); function wpse_100012_override_yoast_breadcrumb_trail( … Read more

Using php to overwrite or replace title tag, while using yoast [closed]

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; } More info at the WordPress SEO API Docs page.