How to Set Mobile Status Bar Color on Android and iOS in WordPress

This snippet sets the color of the mobile browser status bar on smartphones and tablets.

  • On Android, it changes the browser status bar color using the theme-color meta tag.
  • On iOS (Safari / PWA), it enables web app mode and applies a dark, translucent status bar style.

The code is injected into the <head> section using the wp_head hook, which means it affects the entire website without modifying theme files.

The result is a cleaner and more consistent mobile appearance, especially for websites using a dark color scheme.

PHP
add_action( 'wp_head', function() {
    ?>
    <!-- Android -->
    <meta name="theme-color" content="#000000">

    <!-- iOS (Safari / PWA) -->
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
    <?php
});

Leave a Reply

Your email address will not be published. Required fields are marked *