It looks like someone created a plugin that handles this – https://wordpress.org/plugins/favicon-by-realfavicongenerator/
It has 5 stars and they keep it up to date. I’d give that a try if you haven’t already. I haven’t used it myself but I would give that a go if that’s what you’re looking for.
Let me know if it works.