Viewing 3 replies - 1 through 3 (of 3 total)
  • This all depends on you and how comfortable you are on adding it. If you feel that you can trust that company and think that it will allow you to start working with them, then add it. If you have a concern that there’s osmething going on that’s not all above board, then don’t, and explain to them why. Adding Javascript does sound like a very stange way of doing things like this, but it could also easily be just how their system works and is all fine.

    Moderator bcworkz

    (@bcworkz)

    I second that this is a very strange way to prove ownership, this snippet gives them complete control over the content of your site, the only good part is it is temporary. This doesn’t really prove ownership, it proves you have control of the site, which is all they probably really want anyway.

    Site control proof could have easily been done by asking you to place a simple meta tag containing a hashed token in the head section, or by placing a small .html file with the same token in the public html folder. Requiring a script is indeed very strange.

    In the case of WordPress, index.php is the wrong place to put script blocks anyway, you will cause header errors. The proper WP way to embed scripts is to use wp_enqueue_script(), but in this case I think you can get away with putting it in your theme’s header.php file. It’s hard to say where is best, theme files are all different. As long as it’s in the <head> section and outside of any PHP blocks, you should be OK.

    Thread Starter miriamfalk

    (@miriamfalk)

    Big thanks to both of you for the quick response. I put the javascript code into header.php, confirmed that avantlink had verified it was there, and took it out. Whew!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘ok to put this javascript into my index.php page?’ is closed to new replies.