Block All in One SEO from altering site title

Here is the solution to completely remove it’s title filter First disable “force rewrites” in “performance” Then add this code to theme “functions.php” add_action( ‘template_redirect’, ‘remove_aioseo_wp_title’, 1 ); function remove_aioseo_wp_title() { global $aiosp; if( isset( $aiosp ) ) { remove_filter( ‘wp_title’, array( $aiosp, ‘wp_title’ ), 20 ); } } Edit: This is the new code …

Read more

two meta tags with all in one seo

From what I see on that theme it would not be in header.php. It would be related in the theme since it already has an SEO optimization feature built in. You need to go through the functions.php and seek SEO and remove modify this line: $default=”global|slider|layout|seo|translations”; to $default=”global|slider|layout|translations”; Which will remove the setting to be …

Read more

How to restrict an admin page, if the user is not superadmin?

To remove from the admin menu, you could use remove_menu_page(): add_action( ‘admin_menu’, function ( ) { if (is_super_admin()) return; remove_menu_page(); // or remove_submenu_page( … },99); If for some reason the page still exists, it’s just missing it’s menu link, you could check the get_current_screen() to see if the page is being viewed, and prevent access: …

Read more

Remove All in One Pack from the admin bar

You are almost there! If you check out where the plugin developer is adding this action, you’ll see they are setting a priority of 1000. While the priority of your function is being called at 999. https://plugins.trac.wordpress.org/browser/all-in-one-seo-pack/trunk/aioseop_class.php#L3907 Update your priority to be greater than 1000: add_action( ‘admin_bar_menu’, ‘aldous_remove_items_from_admin_bar’, 1200 ); Overriding function calls with plugins …

Read more

add the post as canonical for attachment page wordpress

Here’s an (untested) example where we inject into the header tag on attachment’s pages, the canonical link of the attached post: add_action( ‘wp_head’, ‘wpse_attachment_parent_canonical’ ); function wpse_attachment_parent_canonical() { // Only target attachment’s pages if( ! is_attachment() ) return; $object = get_queried_object(); // Make sure we’re dealing with a WP_Post object if ( ! is_a( $object, …

Read more