Back to Community

Resolving Hard-Coded wp-content Path Issues in Popup Maker

1 threads Sep 16, 2025

Content

If you've customized your WordPress wp-content directory, you might encounter 404 errors for background images within the Popup Maker admin interface. This common issue occurs because the plugin's CSS files contain hard-coded references to the default wp-content path, which breaks when the directory is renamed or moved.

Why This Happens:
WordPress allows developers to customize the wp-content directory path through the WP_CONTENT_DIR and WP_CONTENT_URL constants. Frameworks like Roots Bedrock use this to change the directory name to app. However, if a plugin like Popup Maker uses hard-coded paths in its CSS (e.g., url('/wp-content/plugins/popup-maker/assets/images/example.png')), those requests will fail, resulting in broken images and missing styles.

How to Fix It:
The recommended solution is to create a local copy of the plugin's CSS and modify the paths manually. This approach overrides the default styles without modifying the core plugin files, ensuring your changes persist through updates.

Step-by-Step Solution:

  1. Locate the Core CSS Files: Follow the official Popup Maker documentation to find the core CSS files. These are typically located in wp-content/plugins/popup-maker/assets/css (or your custom equivalent, like app/plugins/popup-maker/assets/css).
  2. Copy and Modify the CSS: Copy the relevant CSS file (e.g., pum-admin.css) to your theme or child theme directory. Use a text editor to perform a global find-and-replace operation, changing all instances of /wp-content/ to your custom directory path (e.g., /app/).
  3. Enqueue Your Custom CSS: Add code to your theme's functions.php file to enqueue your modified CSS file, ensuring it loads after the original plugin styles. Here's an example snippet:

    function custom_fix_pum_css_paths() {
        wp_enqueue_style(
            'pum-custom-admin-css',
            get_stylesheet_directory_uri() . '/path-to-your-modified-file.css',
            array('popup-maker-admin'),
            POPMAKE_VERSION
        );
    }
    add_action( 'admin_enqueue_scripts', 'custom_fix_pum_css_paths', 100 );

Important Note:
This is a known issue with Popup Maker. The development team is tracking it on their GitHub repository (#944). While this workaround is effective, a permanent fix would require the plugin to use dynamic paths for asset URLs.

If this solution doesn't resolve your issue, consider checking the GitHub thread for updates or alternative approaches from other users.

Related Support Threads Support