Remove post and page columns from Smartcrawl

Hi There,
I'm trying to hide the columns created on the post and page tables in wp-admin created by Smartcrawl. In particular, robots meta and title tag.
I have added this code to a custom plugin:

function remove_pages_columns($columns) {
  // Remove checkbox column
  unset($columns['page-title']);

  return $columns;
}
add_filter('manage_pages_columns', 'remove_pages_columns');

function remove_post_columns($columns) {
  // Remove the checkbox
  unset($columns['page-title']);

  // Remove the Author
  unset($columns['page-meta-robots']);

  return $columns;
}
add_filter('manage_posts_columns', 'remove_post_columns');

But it doesn't have any affect - is there another way to achieve this?

  • Adam Czajczyk
    • Support Gorilla

    Hello Samuel,

    I hope you're well today and thank you for your question!

    You can hide these (and other) columns using screen options. To do this for "posts" page go to "Posts" in your site's backend and click on "Screen Options" tab at the top of the screen, then un-check checkboxes for "Title Tag" and "Robots meta":

    Would that work for you?

    Best regards,
    Adam

  • Adam Czajczyk
    • Support Gorilla

    Hello Samuel!

    That makes sense :slight_smile:

    I checked your code and it is actually perfectly fine and will work. All you need to do is to set a priority for your filters like this:

    function remove_pages_columns($columns) {
      // Remove checkbox column
      unset($columns['page-title']);
    
      return $columns;
    }
    add_filter('manage_pages_columns', 'remove_pages_columns',11);
    
    function remove_post_columns($columns) {
      // Remove the checkbox
      unset($columns['page-title']);
    
      // Remove the Author
      unset($columns['page-meta-robots']);
    
      return $columns;
    }
    add_filter('manage_posts_columns', 'remove_post_columns',11);

    The SmartCrawl plugin is also using "manage_posts_columns' and it sets priority to 10 so you need to make sure that your code is executed after the SmartCrawl's one is rune. Setting priority to 11 forces it to be triggered after SmartCrawl's hooks are run.

    I hope that helps :slight_smile:

    Best regards,
    Adam

    • Predrag Dubajic
      • Support

      Hi kelivi,

      There have been a lot of changes since this question was started but you can still do it the way that Adam suggested in the first reply, go to Posts/Pages panel and expand Screen Options dropdown to enable/disable columns you want to show:

      If you have any additional questions please start a new chat or ticket, so we don't bother original poster with response notification emails, and we will gladly assist you further :slight_smile:

      Best regards,
      Predrag

  • kelivi
    • Flash Drive

    Thank for the suggestion, i'll like to remove this with a function.

    I can't get SEO & readability columns to not sure. I tried unsetting them with the code below.

    Please advise.

    function remove_pages_columns($columns) {
    // Remove checkbox column
    unset($columns['page-title']);

    return $columns;
    }
    add_filter('manage_pages_columns', 'remove_pages_columns',11);

    function remove_post_columns($columns) {
    // Remove the checkbox
    unset($columns['page-title']);

    // Remove the Author
    unset($columns['page-meta-robots']);

    // Remove the seo column
    unset($columns['seo']);

    // Remove the readability column
    unset($columns['readability']);

    return $columns;
    }
    add_filter('manage_posts_columns', 'remove_post_columns',11);

    • Predrag Dubajic
      • Support

      Hi kelivi,

      Can you try this code instead and see if that works for you:

      add_action( 'admin_init', function(){
      
          $types = get_post_types(array(
              'public' => true,
              'show_ui' => true,
          ));
          foreach ( $types as $type ) {
              add_filter( "manage_{$type}_posts_columns", 'wpmudev_rm_analysis_columns', 999 );
          }
      
      }, 999 );
      
      function wpmudev_rm_analysis_columns( $columns ){
      
          unset($columns['seo']);
            unset($columns['readability']);
            unset($columns['page-meta-robots']);
            return $columns;
      }

      Best regards,
      Predrag

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.