The WPFolks app is out on iPhone and Android. Free, no ads. Download on the App Store Get it on Google Play
Skip to main content
Login Join

Functions

Automatically Set Alt Text for WordPress Featured Images

Steps Add the PHP code to your child theme’s functions.php file or a PHP snippets plugin. Save and activate the snippet. View a post that has a featured image with no alt text. Hook Used – get_post_metadata — Filters metadata values retrieved for an attachment. Type: WordPress SEO & Accessibility Output: When WordPress retrieves an […]


Add a Duplicate Post Link to the WordPress Admin Posts List

Steps Add the PHP code to your child theme’s functions.php file or a PHP snippets plugin. Activate the snippet. Go to WordPress Admin → Posts → All Posts. Hover over a post and click Duplicate. Hook Used post_row_actions — Adds the Duplicate link to each post. admin_post_custom_duplicate_post — Handles the duplication request securely. Type: WordPress […]


Add a Custom Column Showing Post Word Count in WordPress

Steps Add the PHP code to your child theme’s functions.php file or the Code Snippets plugin. Save and activate the snippet. Navigate to WordPress Admin → Posts → All Posts. Hook Used manage_posts_columns — Adds the Word Count column. manage_posts_custom_column — Displays the word count for each post. Type: WordPress Admin Customization Output: A Word […]


Automatically Add Nofollow to External Links in WordPress Content

Steps Add the PHP code to your child theme’s functions.php file or the Code Snippets plugin. Save and activate the snippet. Open a published post containing external links and inspect the link HTML. Hook Used – the_content — Filters the post content before it is displayed. Type: WordPress SEO Customization Output: HTTP and HTTPS links […]


Add a Custom Column Showing Post Comment Count in WordPress

Steps Add the PHP code to your child theme’s functions.php file or the Code Snippets plugin. Save and activate the snippet. Go to WordPress Admin → Posts → All Posts. Hook Used manage_posts_columns — Adds the Comment Count column. manage_posts_custom_column — Displays the comment count for each post. Type: WordPress Admin Customization Output: A Comment […]


Add a Custom Reading Time Column to the WordPress Posts List

Steps Add the PHP code to your child theme’s functions.php file or the Code Snippets plugin. Save and activate the snippet. Navigate to WordPress Admin → Posts → All Posts. Hook Used manage_posts_columns — Adds the Reading Time column. manage_posts_custom_column — Displays the estimated reading time. Type: WordPress Admin Customization Output: Each post displays an […]


Add a Custom Login Error Message in WordPress

Steps Add the PHP code to your child theme’s functions.php file or the Code Snippets plugin. Save and activate the snippet. Visit the WordPress login page and test with invalid login credentials. Hook Used – login_errors — Filters the error message displayed on the WordPress login screen. Type: WordPress Login Customization Output: WordPress displays your […]


Add a Custom Excerpt Length Based on Post Type in WordPress

Steps Add the PHP code to your child theme’s functions.php file or the Code Snippets plugin. Save and activate the snippet. Check your website’s post excerpts. Hook Used – excerpt_length — Controls the number of words in generated excerpts. Type: WordPress Content Customization Output: The snippet sets the excerpt length to 30 words on single […]


Add a Custom Copyright Footer to WordPress

Steps Add the PHP code to your child theme’s functions.php file or the Code Snippets plugin. Replace Your Website Name with your website or brand name. Save and activate the snippet. Visit your website’s front end to see the footer text. Hook Used – wp_footer — Outputs content near the end of the page, before […]


Automatically Empty WordPress Trash After 2 Days

Steps Add the PHP code to your child theme’s functions.php file or the Code Snippets plugin. Save and activate the snippet. WordPress will use a seven-day trash retention period when its scheduled cleanup runs. Hook Used – empty_trash_days — Sets how many days WordPress retains trashed content before automatic cleanup. Type: WordPress Maintenance Output: Trashed […]


Proudly supported by