Skip to content

Early-bird lifetime licence: $199 once, for the first 200 buyers only. See the offer

50 posts per page in admin lists

The posts, pages and products lists show 50 items per page instead of 20. Each user can still change it under Screen Options.

  • Type PHP
  • Runs Everywhere (runs as WordPress loads)
  • Category Admin area
  • Tested with WordPress 7.1
PHP
<?php

add_action(
	'admin_init',
	static function () {
		foreach ( get_post_types( array( 'show_ui' => true ) ) as $type ) {
			add_filter(
				"edit_{$type}_per_page",
				static function ( $per_page ) use ( $type ) {
					// Only when the user hasn't chosen a number themselves.
					return get_user_option( "edit_{$type}_per_page" ) ? $per_page : 50;
				}
			);
		}
	}
);

In these packs

  • More admin tweaks: Useful columns, a tidier admin bar, a welcome box for clients, and fewer menus for editors.

Move your snippets over this afternoon.

Importing changes nothing until you switch over, and your old shortcodes keep working.