Change Admin Panel Footer Text

Display custom text in the admin panel footer with this snippet.

Use Snippet
php
<?php
add_filter(
	'admin_footer_text',
	function ( $footer_text ) {
		// Edit the line below to customize the footer text.
		$footer_text = 'Powered by <a href="https://www.wordpress.org" target="_blank" rel="noopener">WordPress</a> | WordPress Tutorials: <a href="https://www.wpbeginner.com" target="_blank" rel="noopener">WPBeginner</a>';
		
		return $footer_text;
	}
);
WPCode Team
900+

Change "Howdy Admin" in Admin Bar

Customize the "Howdy" message in the admin bar.

Use Snippet
php
<?php
function wpcode_snippet_replace_howdy( $wp_admin_bar ) {
	// Edit the line below to set what you want the admin bar to display intead of "Howdy,".
	$new_howdy = 'Welcome,';
	$my_account = $wp_admin_bar->get_node( 'my-account' );
	$wp_admin_bar->add_node(
		array(
			'id'    => 'my-account',
			'title' => str_replace( 'Howdy,', $new_howdy, $my_account->title ),
		)
	);
}
add_filter( 'admin_bar_menu', 'wpcode_snippet_replace_howdy', 25 );
WPCode Team
700+

Remove Dashboard Welcome Panel

Hide the Welcome Panel on the WordPress dashboard for all users.

Use Snippet
php
<?php
add_action(
	'admin_init',
	function () {
		remove_action( 'welcome_panel', 'wp_welcome_panel' );
	}
);
WPCode Team
500+

Hide ‘Screen Options’ Tab

Remove the Screen Options menu at the top of admin pages.

Use Snippet
php
<?php
// Hide admin 'Screen Options' tab
add_filter('screen_options_show_screen', '__return_false');
WPCode Team
100+

Set a Minimum Word Count for Posts

Force your authors to write posts that have a minimum length.

Use Snippet
php
<?php
/**
 * Prevent publishing posts under a minimum number of words.
 *
 * @param int     $post_id The id of the post.
 * @param WP_Post $post The post object.
 *
 * @return void
 */
function wpcode_snippet_publish_min_words( $post_id, $post ) {
	// Edit the line below to set the desired minimum number of words.
	$word_count = 100;
	if ( str_word_count( $post->post_content ) < $word_count ) {
		wp_die(
			sprintf(
				// Translators: placeholder adds the minimum number of words.
				esc_html__( 'The post content is below the minimum word count. Your post needs to have at least %d words to be published.' ),
				absint( $word_count )
			)
		);
	}
}
add_action( 'publish_post', 'wpcode_snippet_publish_min_words', 9, 2 );
WPCode Team
90+

Set oEmbed Max Width

Set a max width for the embeds using oEmbed in the content.

Use Snippet
php
<?php
function wpcode_snippet_oembed_defaults( $sizes ) {
	return array(
		'width'  => 400,
		'height' => 280,
	);
}
add_filter( 'embed_defaults', 'wpcode_snippet_oembed_defaults' );
WPCode Team
60+

Waste Licence

Waste carriers affiliation badge

Use Snippet
php
<?php
<iframe style="border: 1px solid #dddddd; overflow: hidden" width="330" height="165" src="https://environment.data.gov.uk/public-register/waste-carriers-brokers/widget/CBDL457468" title="Widget for CBDL457468"></iframe>
Anthony Burnett
<10

Disable Gutenberg Code Editing for Non-Admin Users

Prevent non-admin users from using "Edit as HTML" or "Code editor" in the Gutenberg Editor.

Use Snippet
php
<?php
add_filter( 'block_editor_settings_all', function ( $settings ) {
	
	$settings['codeEditingEnabled'] = current_user_can( 'manage_options' );
	return $settings;
} );
WPCode Team
<10

rexing

fishing camera

Use Snippet
html
<a href="https://www.kqzyfj.com/click-100700341-15218440" target="_top" rel="noopener">
<img src="https://www.awltovhc.com/image-100700341-15218440" width="728" height="90" alt="" border="0"/></a>
Chet fishingfortrout
<10