How to save iframe tag into a post?

iframes get stripped out for security reasons, you shouldn’t be trying to put embed codes directly into post content, there are other methods, such as oembed or shortcodes.

If you have the unfiltered_html capability, you can add them via the classic editor, but this capability is extremely dangerous. It also means any users who don’t have this ability will strip the iframes out, as might any automated processes.

So How Do I Embed Things In My Site?

There are a few options

OEmbed

If you take the URL of a Youtube video and copy paste it into the editor on its own line, it’ll auto-magically turn into an iframe embed. This is OEmbed at work.

You can use OEmbed with lots of services, and there are APIs for adding your own severices. Some 3rd parties act as go betweens adding support for lots of places that don’t normally support OEmbed, such as iframely

Shortcodes

You can add shortcodes in code that lets you embed things into post content. This is how plugins place forms and other complicated markup into the middle of posts.

You could even build an [iframe] shortcode

Content Security Policies and iframes

Note that some things just can’t be put in iframes due to their content security policies, this isn’t a WP limitation but a is fundamental to how iframes and browsers work.