/* Add Favicon to WordPress Manually */
add_action('wp_head', 'wpflt_header_function_favicon');
function wpflt_header_function_favicon(){
?>
<link rel="shortcut icon" href="/path/to/favicon.ico">
<?php
};
If you are not using any SEO plugin, you probably need to manually update Google to consider a favicon for your site. So that, google displays a favicon for the search results belonging to your site in mobile browsers.
Add the above code to your child theme’s functions.php file. Add the correct path to the favicon in Line 5. In our case, its /wpffavicon.png. We have placed the png file in the root folder itself. It can be placed in uploads folder too.