WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I use the ALO EasyMail Newsletter.
But the plugin is loading lots of Javascript in the head.

I have a mobile site and the scripts are loading in all the pages. I think this affects the mobile performance and want to load it only on the newsletter pages.

How can i do that and load it only in the /nieuwsbrief page?

The php starts with:

<script type="text/javascript">
<?php if ( is_user_logged_in() ) { // if logged in ?>
share|improve this question
You need to spend some time on writing your question, and framing it properly. Please take a relook. :) – its_me Jul 6 '12 at 14:44
up vote 4 down vote accepted

Drop this in your functions.php or a custom plugin.

function wpse_57621_alo_tidy()
    if ( $page_id = get_option( 'alo_em_subsc_page' ) ) {
        if ( ! is_page( $page_id ) )
            remove_action( 'wp_head', 'alo_em_ajax_js' );
add_action( 'wp', 'wpse_57621_alo_tidy' );

It's attached to the wp hook, which runs just after the request has been handled & queried.

We're saying "if the ALO newsletter page setting exists, but we're not currently on said page, unattach the script output hook".

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.