Support » Plugin: Cookie Law Info » Text shows up on the new wordpress AMP pages

  • madeglobal


    I have just installed the new wordpress AMP plugin which works well, but unfortunately the new amp pages show the cookie law info text at the bottom which should NOT be there.

    This is a shame as cookie-law-info is a good plugin. Needs to be updated so that it does not show on the /amp/ pages… anyone still maintaining this plugin?

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Richard


    Hi, yes the plugin is still maintained. Currently there is no feature to switch it off on certain pages / permalink structures (e.g. */amp/* ) but that is something I’ll add in a future version. Cheers



    I’ve “fixed” it by changing one line in /php/functions.php

    if (( $the_options[‘is_on’] == true ) && function_exists(‘is_amp_endpoint’) && !(is_amp_endpoint()) ) {

    This works fine, but obviously I don’t like hacking plugins.

    Plugin Author Richard


    I think that’s your best option for now. When I do code this feature it won’t be targeting any specific plugin (given there are > 20,000 that’s not sustainable of course) rather it will be a more generic “don’t show if … ” type of feature.

    It will most probably work best as a hook, so if you fancy coding that and contributing I will happily add it as a feature and credit you with the solution of course

    i.e. something that lets you add custom filters in your functions.php file.

    It’s fairly clear that this plugin doesn’t hook into the right action within WordPress, I’ve now found that your cookie message turns up on the “You don’t have permission” pages that you get when you try to access a page you haven’t got permission for.

    IF the plugin hooked into the correct action then none of this would happen…

    Plugin Author Richard


    Which hook do you think is more suitable than wp_footer?

    The functionality you are requesting is essentially:

    if {current page} is not in {excluded pages} then display cookie banner

    …which is a suggestion I suggested above (as a filter hook, so it’s configurable) and will build when I am next working on new features. This is open source though- if you’d like to contribute an enhancement you are more than welcome.

    Hi Richard,

    I don’t think that is what I’m asking for. It’s just that your message seems to show up on pages where other things in the footer don’t show up. i.e. none of the other plugins which we use and which put things in the footer add their code, but yours does.
    It feels like the hook you’re using isn’t the right one. Must say I haven’t looked at your code in much depth to see what you are using.

    Though I’m not 100% sure, I don’t think that the AMP plugin pages or the “You don’t have permission” actually call wp_footer. So it confuses me as to how your script is popping out when nobody else’s footer code seems to. I don’t understand.

    Plugin Author Richard


    I suggest reading up on the theme template hierarchy which will help debug which template gets fired when. The page you mention may be using a different template to the one you think.

    This plugin doesn’t randomly output content, only against that hook which is the correct one.

    Hi, does the latest version of the plugin have the problem fixed? I want to implement AMP at and I use your plugin to display the cookie warning on this and more pages.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Text shows up on the new wordpress AMP pages’ is closed to new replies.