How to replace default icon on “Add Media” button?

CSS is the way to go here.

Add a new CSS for admin using the admin_enqueue_scripts hook in your child theme functions.php (if you don’t have one, you’re doing something wrong)

function my_admin_enqueue_style() {
    wp_enqueue_style('my-css', get_stylesheet_directory_uri().'/css/my-admin.css', array(), '1.0.0');
}
add_action('admin_enqueue_scripts', 'my_admin_enqueue_style');

In your my-admin.css file

/* change the content to another Dashicon */
#wp-content-editor-tools .wp-media-buttons .add_media span.wp-media-buttons-icon::before {
    content: "\f104";
}

/* or set a background-image instead (set content to "" in the rule before) */
#wp-content-editor-tools .wp-media-buttons .add_media span.wp-media-buttons-icon {
    background-image: url(../../wp-content/uploads/2017/10/my-image.png);
    background-position: center;
}

Available Dashicon icons here

Leave a Comment