# How to automatically adjust iframe height for embedded wordpress posts

**URL:** <https://meta.discourse.org/t/how-to-automatically-adjust-iframe-height-for-embedded-wordpress-posts/127686>\
**Category:** WordPress\
**Created:** [September 5, 2019, 1:06pm UTC](https://meta.discourse.org/t/how-to-automatically-adjust-iframe-height-for-embedded-wordpress-posts/127686 "2019-09-05T13:06:06Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![jrgong](https://avatars.discourse-cdn.com/v4/letter/j/c57346/32.png) [@jrgong](https://meta.discourse.org/u/jrgong)\
**Post date:** [September 5, 2019, 1:06pm UTC](https://meta.discourse.org/t/how-to-automatically-adjust-iframe-height-for-embedded-wordpress-posts/127686/1 "2019-09-05T13:06:07Z")

</div>

I am currently working on a custom embed template for wordpress posts so I can embed them via [wp discourse](https://github.com/discourse/wp-discourse) plugin in an iframe

Currently you can only add a fixed iframe height into the post. The post looks like this:  
[https://forum.cannabisanbauen.net/t/test-embed-fuer-ca-blog/6843](https://forum.cannabisanbauen.net/t/test-embed-fuer-ca-blog/6843)

The HTML used:

```plaintext
<iframe src="https://wordpress-92041-921046.cloudwaysapps.com/growbox-dimensionieren/" width="1200" height="2000" "frameborder="0"></iframe>

```

1. Is there any way to set up the iframe height in a variable manner to adjust to the embedded content size?
2. Since it will be put into a [wp discourse](https://github.com/discourse/wp-discourse) template (like @simon) did [here](https://meta.discourse.org/t/wp-discourse-how-to-deal-with-shortcodes-in-post/58838/4) , is there any way to set the iframe height in a dynamic way based on some parameters of the wp post? (character count or such?)

---

_[View the full topic](https://meta.discourse.org/t/how-to-automatically-adjust-iframe-height-for-embedded-wordpress-posts/127686)._
