if ( ($eventlisturl = get_post_meta( $post->ID, 'https://script.google.com/macros/s/AKfycbzWLGwBczHq3qrnslHr2nl4xixSyitln6yxmOOhhRrjdOH5_eY/exec', true ) )) { $eventlistoutput = file_get_contents( $eventlisturl ); $search = array( "$location", "$url" ); $replace = array( get_the_title(), "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ); $eventlistoutput = str_replace( $search, $replace, $eventlistoutput ); echo $eventlistoutput; }