To rename the page tabs by condition in WordPress, you can use a conditional statement in your theme’s functions.php
file or via a custom plugin. Here’s a simple method using PHP:
Steps:
1. Open functions.php
Go to your theme folder (wp-content/themes/your-theme
) and open functions.php
.
2. Add Conditional Title Filter
Add the following code:
🔁 You can change the conditions using:
-
is_user_logged_in()
-
is_page('slug')
or by ID -
is_mobile()
(with plugin) -
Any custom logic
3. Save & Test
Reload the page on your site to see the new tab name (usually shown in browser tabs as the page title).
Optional: Change <title>
Tag (SEO/browser tab)
To change the browser tab text (not just the visible title), hook into wp_title
or document_title_parts
: