Title: Add script in head
Last modified: August 23, 2021

---

# Add script in head

 *  Resolved [roxer82](https://wordpress.org/support/users/roxer82/)
 * (@roxer82)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/add-script-in-head/)
 * Hello,
    I need to add a script in head for Google ads: `<script async custom-
   element="amp-ad" src="https://cdn.ampproject.org/v0/amp-ad-0.1.js"></script>`
   I’d like to do it without a plugin, because I’m customizing a new design and 
   I don’t want it to interfere with the actual one, so, I should add it from function.
   php or something like that. Thanks.

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

 *  Plugin Support [Milind More](https://wordpress.org/support/users/milindmore22/)
 * (@milindmore22)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/add-script-in-head/#post-14795232)
 * Hello [@roxer82](https://wordpress.org/support/users/roxer82/)
 * Thank you for the support topic, You don’t need to add the script while using
   the AMP plugin, the AMP plugin will find out the AMP component being used & include
   the script required for it.
 * eg: if you use `<amp-ad>` component the plugin will enqueue the script required
   for it, you don’t need to include it specifically again.
 * I hope this helps!
 *  Thread Starter [roxer82](https://wordpress.org/support/users/roxer82/)
 * (@roxer82)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/add-script-in-head/#post-14795299)
 * Hi Milind, thanks for your answer.
    You mean if I add it in head of my regular
   theme it will appear in the amp version? I’m using “Reader theme: AMP Legacy”
   for my AMP version.
 *  Plugin Support [Milind More](https://wordpress.org/support/users/milindmore22/)
 * (@milindmore22)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/add-script-in-head/#post-14795365)
 * Hello [@roxer82](https://wordpress.org/support/users/roxer82/)
 * yes, I mean if you use a component in your theme which can be used as Transitional
   Mode or in Standard mode.
 * To add it in AMP Legacy theme (which is a different theme than your Regular theme)
   
   You will have to use `amp_post_template_head` action hook.
 * In all three cases, you are not required to add the script manually. you just
   need to add the tag `<amp-ad>` in you page (it can be in head,body or footer)
   and the script will be included for the same by the AMP plugin.
 * I will recommend checking out our Guide for modifying [Legacy Theme](https://amp-wp.org/documentation/playbooks/classic-templates/).
 *  [Bethany Chobanian Lang](https://wordpress.org/support/users/mxbclang/)
 * (@mxbclang)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/add-script-in-head/#post-14819505)
 * [@roxer82](https://wordpress.org/support/users/roxer82/) As we haven’t received
   a response, I’ll mark this as resolved. Feel free to open a [new support topic](https://wordpress.org/support/plugin/amp/#new-post)
   if you continue to encounter issues, or reopen this topic and we’d be happy to
   assist. Thank you!

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

The topic ‘Add script in head’ is closed to new replies.

 * ![](https://ps.w.org/amp/assets/icon.svg?rev=2527602)
 * [AMP](https://wordpress.org/plugins/amp/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/amp/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/amp/)
 * [Active Topics](https://wordpress.org/support/plugin/amp/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/amp/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/amp/reviews/)

## Tags

 * [head](https://wordpress.org/support/topic-tag/head/)
 * [script](https://wordpress.org/support/topic-tag/script/)

 * 4 replies
 * 3 participants
 * Last reply from: [Bethany Chobanian Lang](https://wordpress.org/support/users/mxbclang/)
 * Last activity: [4 years, 9 months ago](https://wordpress.org/support/topic/add-script-in-head/#post-14819505)
 * Status: resolved