WordPress action hook · part of WordPress core

wp_body_open

A WordPress core action that 51 plugins also fire themselves, running on 4.2M+ sites between them.

“WP Defaults”

How to use wp_body_open

It's an action: your callback runs at that point. Nothing needs to be returned. Add this to your theme's functions.php or a small custom plugin:

functions.php
add_action( 'wp_body_open', function() {
	// Your code runs here.
}, 10, 1 );

Argument names come from Ultimate Addons for Elementor's source. Other plugins may pass different values: check the call in the plugin you're targeting below.

This hook is fired by WordPress core too. Official reference on developer.wordpress.org →

51 plugins that fire wp_body_open

Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.

  1. Ultimate Addons for Elementor icon Ultimate Addons for Elementor2+ million installs do_action( 'wp_body_open' ) themes/default/hfe-header.php:20
  2. Royal Addons for Elementor icon Royal Addons for Elementor600,000+ installs do_action( 'wp_body_open' ) admin/templates/views/royal/theme-header-royal.php:31
  3. Kirki icon Kirki400,000+ installs do_action( 'wp_body_open' ) includes/Frontend/views/template/page.php:60
  4. Templately icon Templately300,000+ installs do_action( 'wp_body_open' ) views/templates/header.php:21
  5. Jeg Kit for Elementor icon Jeg Kit for Elementor300,000+ installs do_action( 'wp_body_open' ) templates/single-template.php:12
  6. CartFlows icon CartFlows200,000+ installs do_action( 'wp_body_open' ) classes/class-cartflows-functions.php:525
  7. PowerPack Addons for Elementor: Widgets, Form Styler and Templates icon PowerPack Addons for Elementor: Widgets, Form Styler and Templates70,000+ installs do_action( 'wp_body_open' ) classes/theme-support/includes/ppe-header.php:19
  8. Brizy icon Brizy60,000+ installs do_action( 'wp_body_open' ) public/views/templates/brizy-blank-template.php:27
  9. Post and Page Builder by BoldGrid icon Post and Page Builder by BoldGrid50,000+ installs do_action( 'wp_body_open' ) includes/template/page/content-only.php:12
  10. Themesflat Addons For Elementor icon Themesflat Addons For Elementor40,000+ installs do_action( 'wp_body_open' ) tf-header.php:12
  11. Sina Extension for Elementor icon Sina Extension for Elementor40,000+ installs do_action( 'wp_body_open' ) inc/templates/header.php:25
  12. Master Addons for Elementor icon Master Addons for Elementor30,000+ installs do_action( 'wp_body_open' ) inc/admin/theme-builder/templates/views/ma-canvas.php:32
  13. Gutentor icon Gutentor30,000+ installs do_action( 'wp_body_open' ) page-templates/template-gutentor-canvas.php:22
  14. Xpro Theme Builder For Elementor icon Xpro Theme Builder For Elementor20,000+ installs do_action( 'wp_body_open' ) inc/templates/blank.php:15
  15. Fluid Checkout for WooCommerce icon Fluid Checkout for WooCommerce20,000+ installs do_action( 'wp_body_open' ) templates/compat/themes/enfold/checkout-page-template/checkout/page-checkout-header.php:231
  16. Animation Addons for Elementor icon Animation Addons for Elementor10,000+ installs do_action( 'wp_body_open' ) templates/header.php:22
  17. Nexter Extension icon Nexter Extension10,000+ installs do_action( 'wp_body_open' ) include/classes/load-pages/template/nxt-header.php:22
  18. King Addons for Elementor icon King Addons for Elementor10,000+ installs do_action( 'wp_body_open' ) includes/extensions/Header_Footer_Builder/themes/default/ELHF_Default_Header.php:15
  19. MotoPress Hotel Booking Styles & Templates icon MotoPress Hotel Booking Styles & Templates10,000+ installs do_action( 'wp_body_open' ) includes/template-editor/includes/templates/single/canvas.php:27
  20. EleSpare icon EleSpare10,000+ installs do_action( 'wp_body_open' ) header-footer/templates/compat/elespare.php:5
  21. aThemes Addons for Elementor icon aThemes Addons for Elementor7,000+ installs do_action( 'wp_body_open' ) inc/theme-builder/templates/header.php:17
  22. Magazine Blocks icon Magazine Blocks6,000+ installs do_action( 'wp_body_open' ) includes/Templates/template-render.php:12
  23. WPFunnels icon WPFunnels5,000+ installs do_action( 'wp_body_open' ) includes/core/page-templates/class-manager.php:288
  24. easy.jobs icon easy.jobs4,000+ installs do_action( 'wp_body_open' ) includes/class-easyjobs-helper.php:1823
  25. News Kit Addons For Elementor icon News Kit Addons For Elementor3,000+ installs do_action( 'wp_body_open' ) admin/templates/parts/builder-header-render.php:22
  26. Job Manager & Career icon Job Manager & Career1,000+ installs do_action( 'wp_body_open' ) templates/single-thjm_jobs.php:67
  27. WP Helper Premium icon WP Helper Premium1,000+ installs do_action( 'wp_body_open' ) views/frontend/pages/thankyou-template.php:162
  28. Animation Pack icon Animation Pack900+ installs do_action( 'wp_body_open' ) modules/theme-builder/templates/header.php:24
  29. X Addons for Elementor icon X Addons for Elementor800+ installs do_action( 'wp_body_open' ) core-class/header-footer/xaddons-header.php:20
  30. ST Elementor Addons icon ST Elementor Addons500+ installs do_action( 'wp_body_open' ) theme-builder/inc/templates/blank.php:15
  31. StoreBuild icon StoreBuild400+ installs do_action( 'wp_body_open' ) templates/theme-replacement.php:27
  32. Add Custom Header Images icon Add Custom Header Images400+ installs do_action( 'wp_body_open' ) add-custom-header-images.php:228
  33. CRT Addons Builder and Widgets for Elementor icon CRT Addons Builder and Widgets for Elementor300+ installs do_action( 'wp_body_open' ) includes/customizer/addons/templates/views/theme-header.php:29
  34. Source Lens icon Source Lens300+ installs do_action( 'wp_body_open' ) includes/class-slcf-runtime-scanner.php:368
  35. Vertex Addons for Elementor icon Vertex Addons for Elementor200+ installs do_action( 'wp_body_open' ) html/admin/menus/builder/editor/header/tpl.php:24
  36. Softtemplates For Elementor icon Softtemplates For Elementor200+ installs do_action( 'wp_body_open' ) overrides/header-override.php:23
  37. AboveWP Page Loader icon AboveWP Page Loader100+ installs do_action( 'wp_body_open' ) abovewp-page-loader.php:311
  38. Fast Yandex Metrika icon Fast Yandex Metrika100+ installs do_action( 'wp_body_open' ) fast-yandex-metrika.php:235
  39. Pie Forms icon Pie Forms80+ installs do_action( 'wp_body_open' ) includes/form/preview-template.php:29
  40. Simple Alert System icon Simple Alert System40+ installs do_action( 'wp_body_open' ) classes.php:11
  41. Elite Elementor Addons and Widgets icon Elite Elementor Addons and Widgets20+ installs do_action( 'wp_body_open' ) admin/templates/views/elite/theme-header-elite.php:31
  42. Max Elements for Elementor icon Max Elements for Elementor10+ installs do_action( 'wp_body_open' ) inc/theme-builder/inc/templates/blank.php:15
  43. Magic Elements icon Magic Elements10+ installs do_action( 'wp_body_open' ) includes/MBuilder/templates/header.php:18
  44. Live Chat for WordPress icon Live Chat for WordPress10+ installs do_action( 'wp_body_open' ) includes/compatibility.php:13
  45. CC-Scripts icon CC-Scripts10+ installs do_action_deprecated( 'wp_body_open', array(), '2.0.0', 'wp_body' ) includes/functions.php:13
  46. MotaWord Translation icon MotaWord Translation10+ installs do_action( 'wp_body_open', 'wp_admin_bar_render', 0 ) includes/class-motaword-active-serve.php:299
  47. Glidy Addons for Elementor icon Glidy Addons for Elementor10+ installs do_action( 'wp_body_open' ) templates/header.php:22
  48. LC Addons Kit for Elementor icon LC Addons Kit for ElementorFewer than 10 installs do_action( 'wp_body_open' ) includes/lcake-header-footer-builder.php:484
  49. Glossy Mega Menu icon Glossy Mega MenuFewer than 10 installs do_action( 'wp_body_open' ) includes/glossymm-hf/themes/default/glossymm-header.php:26
  50. Pixels Core Creative Tools for Elementor icon Pixels Core Creative Tools for ElementorFewer than 10 installs do_action( 'wp_body_open' ) includes/theme-builder/themes/default/pixeccte-header.php:26
  51. Huge Addons for Elementor icon Huge Addons for ElementorFewer than 10 installs do_action( 'wp_body_open' ) includes/Classes/HeaderFooter/Renderer.php:337

Need a customisation built on this hook?

Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.