Remove apple-touch-icon link generated by WordPress

I am adding Favicons and Icons to my site manually in a more proper way than what WordPress adds by default. My WordPress is generating the below 4 lines of code automatically.

<link rel="icon" href="" sizes="32x32">
<link rel="icon" href="" sizes="192x192">
<link rel="apple-touch-icon-precomposed" href="">
<meta name="msapplication-TileImage" content="">

I tried a lot but could not figure out how to stop WordPress from generating this.

Kindly help

After using the function provided by @Gareth, I am getting the following error:

Warning: array_filter() expects parameter 1 to be array, null given in C:\xampp\htdocs\example\wp-includes\general-template.php on line 2466

Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\example\wp-includes\general-template.php on line 2468

Solutions Collecting From Web of "Remove apple-touch-icon link generated by WordPress"

Finally I found the answer outside of this place, hence I am posting it here as it may be useful to someone like me.

Simply add this to your functions.php file

remove_action ('wp_head', 'wp_site_icon', 99);

from looking at line 2446 of general-template.php where the meta tags are defined, they are defined in an array of $meta_tags, the only way I could think of to remove the 2 options you want is:

function theme_metatags($meta_tags) {
 array_splice($meta_tags, 2);
add_filter('site_icon_meta_tags', 'theme_metatags');

That should remove the last 2 icons from the array which is the 2 lines in your post.

I haven’t tested this and it’s probably not the ideal solution (hopefully someone else will be able to work out a better way).