Title: placing code from advertising network
Last modified: March 11, 2022

---

# placing code from advertising network

 *  [jp123](https://wordpress.org/support/users/jp123/)
 * (@jp123)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/placing-code-from-advertising-network/)
 * I would like to put the code from my advertising network. I need to put the code
   just below <body> but when I do that code just disappears. could you please guide
   me how to do it. thank you.
    -  This topic was modified 4 years, 1 month ago by [Jan Dembowski](https://wordpress.org/support/users/jdembowski/).
      Reason: Moved to Fixing WordPress, this is not an Everything else WordPress
      topic
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fplacing-code-from-advertising-network%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 15 replies - 1 through 15 (of 26 total)

1 [2](https://wordpress.org/support/topic/placing-code-from-advertising-network/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/placing-code-from-advertising-network/page/2/?output_format=md)

 *  [Vijay Hardaha](https://wordpress.org/support/users/vijayhardaha/)
 * (@vijayhardaha)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/placing-code-from-advertising-network/#post-15450258)
 * hey [@jp123](https://wordpress.org/support/users/jp123/),
 * Can you please tell us how you’re adding code after the `<body>` tag? Are you
   editing PHP files or using plugins or using hooks?
 * Best,
    Vijay
 *  Thread Starter [jp123](https://wordpress.org/support/users/jp123/)
 * (@jp123)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/placing-code-from-advertising-network/#post-15451589)
 * I’m trying to add code from propellerads.
 * 1st I tried add code at appearance then theme file editor after that header.php
   then I put the code just below <body> then saved file. I tried few theme but 
   did not work.
 * 2nd propellerads has plugin and I set up all correct but ad code not showing 
   up on my site.
 * I asked propellerads support and they checked but could not find solution and
   they asked me to ask wordpress support.
 *  [Vijay Hardaha](https://wordpress.org/support/users/vijayhardaha/)
 * (@vijayhardaha)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/placing-code-from-advertising-network/#post-15452387)
 * Hey [@jp123](https://wordpress.org/support/users/jp123/)
 * I can see you’re using `twentytwelve` theme, so when you’re editing header.php
   make sure you’re editing the correct theme file.
 *     ```
       <body <?php body_class(); ?>>
       <?php wp_body_open(); ?>
       ```
   
 * You’ll find code like this, in the header.php and you can put your code before`
   <?php wp_body_open(); ?>` line and save the changes.
 * However, there are many reasons that your code not showing after the body tag.
 * 1. Cache/Optimization plugins remove or modify some js script codes.
    2. Cache/
   Optimization plugins put all the js code at the bottom of the page.
 * if you’re putting the code, I suggested disabling the cache plugin and then putting
   the code and checking if it works.
 * Note: I highly suggest creating a backup before making any changes to settings
   or editing files.
 * Best,
    Vijay
 *  Thread Starter [jp123](https://wordpress.org/support/users/jp123/)
 * (@jp123)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/placing-code-from-advertising-network/#post-15452957)
 * I have disabling the cache plugin and placed the code but still not working.
   
   I put the code then click save then it said success, but when I go back to see
   the header.php file again the code I just put is gone and leaves empty space 
   in there.
 * any other suggestion? thank you for your help.
 *  [Vijay Hardaha](https://wordpress.org/support/users/vijayhardaha/)
 * (@vijayhardaha)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/placing-code-from-advertising-network/#post-15452972)
 * Can you send a screenshot of the code that you’re trying to add?
 * **Note: Blur/Hide any information in the screenshot that shouldn’t be shared 
   in public.**
 *  Thread Starter [jp123](https://wordpress.org/support/users/jp123/)
 * (@jp123)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/placing-code-from-advertising-network/#post-15453103)
 * screenshot
    [http://tsuyoshisuzuki.com/images/code.png](http://tsuyoshisuzuki.com/images/code.png)
 *  [Vijay Hardaha](https://wordpress.org/support/users/vijayhardaha/)
 * (@vijayhardaha)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/placing-code-from-advertising-network/#post-15453134)
 * I have tried to add similar js code via theme editor. The code was showing properly.
 * Can you try editing via FTP?
 *  Thread Starter [jp123](https://wordpress.org/support/users/jp123/)
 * (@jp123)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/placing-code-from-advertising-network/#post-15453577)
 * I tried with FTP but still the same, code just disappears…
 *  [Vijay Hardaha](https://wordpress.org/support/users/vijayhardaha/)
 * (@vijayhardaha)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/placing-code-from-advertising-network/#post-15453582)
 * That’s strange, Can you confirm file transfer was successful after making changes
   in the file via FTP?
 * And do you have any security plugins installed?
 *  Thread Starter [jp123](https://wordpress.org/support/users/jp123/)
 * (@jp123)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/placing-code-from-advertising-network/#post-15453639)
 * yes I am sure file transfer was successful.
 * no security plugins installed
 *  Thread Starter [jp123](https://wordpress.org/support/users/jp123/)
 * (@jp123)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/placing-code-from-advertising-network/#post-15453644)
 * how about permission things matter?
 * [http://tsuyoshisuzuki.com/images/code2.png](http://tsuyoshisuzuki.com/images/code2.png)
 * it set as writable right?
 *  [Vijay Hardaha](https://wordpress.org/support/users/vijayhardaha/)
 * (@vijayhardaha)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/placing-code-from-advertising-network/#post-15453648)
 * Permission looks ok, 644 is for files and 755 for folders/directories.
 * Can you edit the file and save changes, then note the last modified timestamp
   and check the website if changes are loading or not.
 * check refresh the FTP and not the last modified again and see if there is any
   change in the last modified?
 *  Thread Starter [jp123](https://wordpress.org/support/users/jp123/)
 * (@jp123)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/placing-code-from-advertising-network/#post-15453832)
 * yes last modified timestamp update to now but code still disappears
 *  Thread Starter [jp123](https://wordpress.org/support/users/jp123/)
 * (@jp123)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/placing-code-from-advertising-network/#post-15453928)
 * ad network recommended to me to place the code in widgets.
    when I try to save
   it it get error below.
 * [http://tsuyoshisuzuki.com/images/code3.png](http://tsuyoshisuzuki.com/images/code3.png)
 * somehow my site is not saving the code on my site.
 * plugin, widgets or directly put code all the code I put keep disappearing after
   few secounds.
 * maybe some setting of my site is auto deleting the code?
 *  [Vijay Hardaha](https://wordpress.org/support/users/vijayhardaha/)
 * (@vijayhardaha)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/placing-code-from-advertising-network/#post-15455274)
 * > maybe some setting of my site is auto deleting the code?
 * You can try to contact your hosting support and find out if they have any security
   thing running on a server or on WordPress that could cause something like this.

Viewing 15 replies - 1 through 15 (of 26 total)

1 [2](https://wordpress.org/support/topic/placing-code-from-advertising-network/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/placing-code-from-advertising-network/page/2/?output_format=md)

The topic ‘placing code from advertising network’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 26 replies
 * 2 participants
 * Last reply from: [Vijay Hardaha](https://wordpress.org/support/users/vijayhardaha/)
 * Last activity: [4 years ago](https://wordpress.org/support/topic/placing-code-from-advertising-network/page/2/#post-15461896)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
