25% off ProSNIPC25OFF

Snippet library

PHP snippets for WordPress.

467 free & Pro snippets and modules. Copy-paste-ready, or import in one click with SnipCraft.

PHP

Disable Author Archive Pages

301-redirects all author archive URLs to the homepage, effectively disabling them to reduce user enumeration exposure.

#authors#redirects#security
PHP

Set Default Admin List Screen Per-Page Count

Sets the default number of rows shown on admin list tables to 25 for users who have not yet changed the preference.

#admin#lists#pagination
PHP

Add Featured Image Column to Posts List

Inserts a thumbnail preview column before the Title column in the wp-admin Posts list table.

#admin#columns#featured-image
PHP

Add Custom Body Class on Login Page

Appends a custom CSS class to the body tag on wp-login.php for targeted login-page styling.

#branding#css#customization
PHP

Replace "Howdy" Greeting in Admin Bar

Swaps the "Howdy, Username" text in the admin bar with a plain "Hello, Username" for a more neutral tone.

#admin#admin-bar#branding
PHP

Hide Update Nag for Non-Admins

Removes the WordPress core update notification banner for users without the manage_options capability.

#admin#notices#roles
PHP

Remove WordPress Logo from Admin Bar

Removes the WordPress logo menu node from the admin toolbar for all users.

#admin#admin-bar#branding
PHP

Generic Login Error Message

Replaces specific login error messages with a generic one to prevent username and email enumeration.

#hardening#login#security
PHP

Hide Admin Bar for Non-Admins on Front End

Removes the front-end admin toolbar for logged-in users who do not have the manage_options capability.

#admin-bar#frontend#roles
PHP

Custom Admin Footer Text

Replaces the default 'Thank you for creating with WordPress' footer credit in wp-admin with your site name.

#admin#branding#customization
PHP

Remove Dashboard Welcome Panel

Hides the default Welcome to WordPress panel shown at the top of the dashboard for all users.

#admin#cleanup#dashboard