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 […]
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 […]
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 […]
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 […]
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 […]
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 […]
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 […]
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 […]
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 […]
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 […]