Created
January 3, 2026 18:00
-
-
Save ayoubkhan558/8844d05c942e6924dce186a7911e0d84 to your computer and use it in GitHub Desktop.
How to change the position of an admin notice in the WordPress admin dashboard using HTML instead of JavaScript?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| I found that using `<hr class="wp-header-end">` works reliably, and the admin notice always appears directly below it. |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I recently discovered by accident that WordPress moves all admin notices to appear after the first
<h1>or<h2>tag inside a<div class="wrap">, with preference given to<h1>if it exists. This provides some control—for example, on a plugin settings page, you can place an empty<h2></h2>at the very top if you want to use<h2>Plugin Title</h2>without affecting the page’s formatting. The JavaScript responsible for this behavior can be found in/wp-admin/js/common.js.