Title: Best block for JavaScript or iframe
Last modified: May 11, 2025

---

# Best block for JavaScript or iframe

 *  Resolved [Earl_D](https://wordpress.org/support/users/earl_d/)
 * (@earl_d)
 * [1 year ago](https://wordpress.org/support/topic/best-block-for-javascript-or-iframe/)
 * what is the best way to paste JavaScript or iframe into page when using block
   editor?

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [Muhibul Haque](https://wordpress.org/support/users/devmuhib/)
 * (@devmuhib)
 * [1 year ago](https://wordpress.org/support/topic/best-block-for-javascript-or-iframe/#post-18466890)
 * HI [@earl_d](https://wordpress.org/support/users/earl_d/)
 * You can simply use Custom HTML block to add JavaScript or iFrame.
    - Add a **Custom HTML** block to your page.
    - Paste your JavaScript or iframe code into the block.
    - Click “**Preview**” to ensure it displays as expected.
 * Best regards,
   Muhibul
 *  Thread Starter [Earl_D](https://wordpress.org/support/users/earl_d/)
 * (@earl_d)
 * [1 year ago](https://wordpress.org/support/topic/best-block-for-javascript-or-iframe/#post-18468386)
 * thanks that is what I ended up doing.
 *  [Muhibul Haque](https://wordpress.org/support/users/devmuhib/)
 * (@devmuhib)
 * [1 year ago](https://wordpress.org/support/topic/best-block-for-javascript-or-iframe/#post-18475855)
 * I also use this way to add custom codes. Thanks

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Best block for JavaScript or iframe’ is closed to new replies.

 * ![](https://ps.w.org/gutenberg/assets/icon-256x256.jpg?rev=1776042)
 * [Gutenberg](https://wordpress.org/plugins/gutenberg/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/gutenberg/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/gutenberg/)
 * [Active Topics](https://wordpress.org/support/plugin/gutenberg/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/gutenberg/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/gutenberg/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Muhibul Haque](https://wordpress.org/support/users/devmuhib/)
 * Last activity: [1 year ago](https://wordpress.org/support/topic/best-block-for-javascript-or-iframe/#post-18475855)
 * Status: resolved