Title: <abbr title="Not Safe For Work / Mature content">[NSFW]</abbr> Loading after content
Last modified: January 16, 2025

---

# [NSFW] Loading after content

 *  [milanmaster](https://wordpress.org/support/users/milanmaster/)
 * (@milanmaster)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/loading-after-content/)
 * I am currently using the Age Gate plugin on my website, but I’m experiencing 
   an issue. The Age Gate does not load as the first element on the site. Instead,
   the rest of the site content (including scripts and styles) loads first, which
   defeats the purpose of restricting access to underage users.
 * Additionally, we use **FlyingPress** for optimization, including defer and delay
   for scripts. This may be affecting the loading sequence of the Age Gate. Could
   you please guide me on how to:
    1. Ensure that the Age Gate loads first, regardless of the FlyingPress optimization
       settings?
    2. Block or delay other scripts and styles from rendering until the Age Gate confirmation
       is completed?
 * I’ve attempted the following so far:
    - Enqueuing the Age Gate scripts and styles as a priority using WordPress hooks.
    - Using filters to delay other scripts until the Age Gate confirmation.
 * Despite these attempts, the rest of the content still renders momentarily before
   the Age Gate appears.
 * Any guidance, including specific settings for FlyingPress or adjustments to the
   Age Gate configuration, would be greatly appreciated.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Floading-after-content%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Phil](https://wordpress.org/support/users/philsbury/)
 * (@philsbury)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/loading-after-content/#post-18248528)
 * Hi [@milanmaster](https://wordpress.org/support/users/milanmaster/),
 * I’ve just loaded your site with various throttle speeds and I see age gate pretty
   much as the first thing and certainly before any content, so did you get a solution?
 * My suggestions were going to be:
 * Set the “In header” mode – which it looks like you done.
   And to ensure that the
   age gate JS isn’t deferred in that instance, which is also looks like you done.
   Do let me know either way.
 * Thanks
   Phil
 *  Thread Starter [milanmaster](https://wordpress.org/support/users/milanmaster/)
 * (@milanmaster)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/loading-after-content/#post-18256786)
 * Hello, thanks  “In header” mode fix issue – also when I exclude “defer script”
   and “delay script” in flyingpress plugin for optimization.
 * Just can’t make google page speed score for mobile (for desktop good) ” agegate.
   js” render-blocking page. But I think it need to “block”. Can you give us your
   opinion?
 *  Plugin Author [Phil](https://wordpress.org/support/users/philsbury/)
 * (@philsbury)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/loading-after-content/#post-18261908)
 * Hi [@milanmaster](https://wordpress.org/support/users/milanmaster/) – I’d imagine
   if FlyingPress allows you to `defer` the script it will probably allow you to
   set it to `async` which I think will prevent the page speed issue (did in a test
   for me).
 * Developer can set these themselves now (since WP 6.3) so I’ll look at doing those
   things myself in future.
 * Thanks
   Phil

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘[NSFW] Loading after content’ is closed to new replies.

 * ![](https://ps.w.org/age-gate/assets/icon-256x256.png?rev=2783003)
 * [Age Gate](https://wordpress.org/plugins/age-gate/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/age-gate/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/age-gate/)
 * [Active Topics](https://wordpress.org/support/plugin/age-gate/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/age-gate/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/age-gate/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Phil](https://wordpress.org/support/users/philsbury/)
 * Last activity: [1 year, 4 months ago](https://wordpress.org/support/topic/loading-after-content/#post-18261908)
 * Status: not resolved