Title: Site URL Shortcode
Last modified: October 4, 2020

---

# Site URL Shortcode

 *  [Kauê Jones](https://wordpress.org/support/users/kauejones/)
 * (@kauejones)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/site-url-shortcode/)
 * Hello, I added this code in `functions.php` and the shortcode [site_url] worked
   fine on WordPress editor. But when I tried to add the shortcode in Elementor,
   https:// link was created without a colon, [link](https://monosnap.com/file/PV2vfow9lHwJ8DHypPufhBQ4vqc2B8).
 *     ```
       add_action( 'init', function() {
   
       	add_shortcode( 'site_url', function( $atts = null, $content = null ) {
       		return site_url();
       	} );
   
       } );
       ```
   
 * Could someone help me solve this?
    It has been a huge inconvenience to migrate
   wordpress installations and need to organize several links again.
 * Thanks.

Viewing 1 replies (of 1 total)

 *  [lucasdraney](https://wordpress.org/support/users/lucasdraney/)
 * (@lucasdraney)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/site-url-shortcode/#post-13773258)
 * I’m having the same issue. I don’t see an obvious work-around yet!

Viewing 1 replies (of 1 total)

The topic ‘Site URL Shortcode’ is closed to new replies.

 * ![](https://ps.w.org/elementor/assets/icon-256x256.gif?rev=3444228)
 * [Elementor Website Builder - more than just a page builder](https://wordpress.org/plugins/elementor/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/elementor/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/elementor/)
 * [Active Topics](https://wordpress.org/support/plugin/elementor/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/elementor/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/elementor/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [lucasdraney](https://wordpress.org/support/users/lucasdraney/)
 * Last activity: [5 years, 6 months ago](https://wordpress.org/support/topic/site-url-shortcode/#post-13773258)
 * Status: not resolved