Skip to content

When "Hide from search results" is enabled for post_type/taxonomy: don't add "Meta title", "Meta desc." and "Index" columns admin list view #252

@joostdekeijzer

Description

@joostdekeijzer

Currently even when "Hide from search results" is enabled in the Slim SEO settings, the columns "Meta title", "Meta desc." and "Index" columns are added to the Admin list views.

The seem unnecessary?

A simple modification of Post.php and Term.php makes adding the columns follow the Slim SEO settings, eg. (after adding use SlimSEO\Helpers\Option; at the top)

	public function setup_admin() {
		parent::setup_admin();

		foreach ( $this->types as $type ) {
			if ( ! Option::get( "{$type}.noindex", false ) ) {
				add_filter( "manage_{$type}_posts_columns", [ $this, 'columns' ] );
				add_action( "manage_{$type}_posts_custom_column", [ $this, 'render' ], 10, 2 );
			}
		}
	}

I can create a PR if you want.

Related would be not showing the "Search Engine Optimization" block on the item page.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions