• Resolved M3

    (@emmtre)


    In earlier version you could hide the SEO columns with this code. Any idea how to do this in the new 3.0 version? I need to hide these columns for some users.

    //* Remove SEO columns and page analysis
    add_filter( ‘wpseo_use_page_analysis’, ‘__return_false’ );

    https://wordpress.org/plugins/wordpress-seo/

Viewing 13 replies - 1 through 13 (of 13 total)
  • +1 for this. Filter no longer works for me either since upgrading to v3.0.

    Thread Starter M3

    (@emmtre)

    Anyone have any idea? Yoast still has this filter in the knowledge base.

    http://kb.yoast.com/article/285-can-i-disable-the-page-analysis

    I reported pretty much the same problem (trying to disable page analysis all together using this same filter) here: https://wordpress.org/support/topic/disable-page-analysis-filter-not-working?replies=1

    Just updated to 3.0.3 and can confirm the filter still doesn’t work.

    My previous code for removing the columns also no longer works (but did prior to update):

    //* Remove SEO dropdown filter in Admin
    add_action( 'admin_init', 'wpse151723_remove_yoast_seo_posts_filter', 20 );
    
    function wpse151723_remove_yoast_seo_posts_filter() {
        global $wpseo_metabox;
    
        if ( $wpseo_metabox ) {
            remove_action( 'restrict_manage_posts', array( $wpseo_metabox, 'posts_filter_dropdown' ) );
        }
    }

    Thread Starter M3

    (@emmtre)

    The wpseo_use_page_analysis filter is still there but the code is different. Please see the class-metabox.php and class-meta-columns.php files.

    public function setup_page_analysis() {
      if ( apply_filters( 'wpseo_use_page_analysis', true ) === true ) {
        add_action( 'post_submitbox_start', array( $this, 'publish_box' ) );
      }
    }
    public function __construct() {
      if ( apply_filters( 'wpseo_use_page_analysis', true ) === true ) {
        add_action( 'admin_init', array( $this, 'setup_hooks' ) );
      }
    }
    Thread Starter M3

    (@emmtre)

    @tacoverdo
    Is this filter supposed to work in the new 3.x version?
    http://kb.yoast.com/article/285-can-i-disable-the-page-analysis

    Plugin Support Taco Verdonschot

    (@tacoverdo)

    Yes, it is supposed to work in 3.0.x.

    Could you please create a bug report on GitHub, we’ll then milestone it for the next patch.

    Thread Starter M3

    (@emmtre)

    @tacoverdo
    Thanx for your quick reply. I’ll do that.

    Thread Starter M3

    (@emmtre)

    All, please chime in here since they are talking about to remove this filter since it’s not working anymore in the 3.x version!

    add_filter( ‘wpseo_use_page_analysis’, ‘__return_false’ );

    https://github.com/Yoast/wordpress-seo/issues/3464

    I’ve added my two cents to the github bug report too as I’d hate to see this filter removed for good.

    I love how every update removes useful features and ads things no one need aimed to increase revenue but achieving the opposite.

    Make things for the users not the money like when you started the plugin and you’ll earn much more.

    This filter doesn’t work anymore because it’s located in the class constructor – too early for any actions taken in functions.php

    You have to call the global var directly:

    remove_action( 'admin_init', array( $GLOBALS['wpseo_meta_columns'], 'setup_hooks' ) );

    Thread Starter M3

    (@emmtre)

    @dfactory Many thanx for a solution that finally works!

    With version 3.8
    add_filter( ‘wpseo_use_page_analysis’, ‘__return_false’ );
    is still working.

    However, there are still “SEO” and “Readability” columns in the Categories and Tags pages in WP admin.

    These I could only remove by editing the class-taxonomy-columns.php file and inserting two lines as marked:

     /**
      * WPSEO_Taxonomy_Columns constructor.
      */
     public function __construct() {
    
      $this->taxonomy = $this->get_taxonomy();
    /*------ inserted one line below ------*/
    if ( apply_filters( 'wpseo_use_page_analysis', true ) === true ) {  
          if ( ! empty( $this->taxonomy ) ) {
           add_filter( 'manage_edit-' . $this->taxonomy . '_columns', array( $this, 'add_columns' ) );
           add_filter( 'manage_' . $this->taxonomy . '_custom_column', array( $this, 'parse_column' ), 10, 3 );
          }
    /*------ inserted one line below ------*/
    } 
      $this->analysis_seo = new WPSEO_Metabox_Analysis_SEO();
      $this->analysis_readability = new WPSEO_Metabox_Analysis_Readability();
    
     }

    This is the same logic employed in class-meta-columns.php

    I hope that Yoast can adopt this so that the filter
    add_filter( ‘wpseo_use_page_analysis’, ‘__return_false’ );
    works consistently.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Hide SEO Columns’ is closed to new replies.