WordPress Integration

WordPress Plugin

You can easily use a shortcode to shorten links with our WordPress plugin. You just need to download it below and upload it in WordPress and that is it. There is no need to configure it as it will be already configured for you. All of your links will be saved in your account

    Do not share this plugin with anyone you do not trust as they will have access to the full API and essentially your account.

Instructions

How to install wordpress plugin.

Examples

The following code will apply the shortcode “shorturl” to the system and you will be able to use the following format.

				
					[shorturl] Any URL [/shorturl]

e.g, [shorturl]https://google.com[/shorturl]
				
			

You can also use the shortcode in html.

				
					<a href="[shorturl] Any URL [/shorturl]">Google</a>

e.g, <a href="[shorturl]https://google.com[/shorturl]">Google</a>
				
			

WordPress Shortcode Function

You can now shorten links directly from WordPress using shortcode. If you don’t want to upload a plugin, you can use this method. It is very easy to setup and it works with all versions of WordPress and with any theme. All links you will shorten will be safely stored in your account.

Instructions

How to add Recut PHP Code to wordpress files.

Your Unique Code

  Do not share this code with anyone you do not trust as they will have access to the full API and essentially your account.

				
					// This code simply registers the shortcode "shorturl". You can change it if you want something else
add_shortcode("shorturl", "pus_shortcode_shorten_url");

// Function to send the request
function pus_shortcode_shorten_url($atts, $content){

    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, "https://app.recut.in/api/url/add");
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(["url" => $content]));
    curl_setopt($ch, CURLOPT_TIMEOUT, 10);
    curl_setopt($ch, CURLOPT_HTTPHEADER, [
        "Authorization: Bearer PASTE_YOUR_API_KEY_HERE",
        "Content-Type: application/json"
    ]);

    $response = curl_exec($ch);
    curl_close($ch);

    $object = json_decode($response);

    if($object && isset($object->shorturl)){
        return $object->shorturl;
    }

    return $content;
}
				
			

Examples

The following code will apply the shortcode “shorturl” to the system and you will be able to use the following format.

				
					[shorturl] Long URL [/shorturl]

e.g, [shorturl]https://google.com[/shorturl]
				
			

You can also use the shortcode in html.

				
					<a href="[shorturl] Long URL [/shorturl]">Google</a>


e.g, <a href="[shorturl]https://google.com[/shorturl]">Google</a>

				
			

Integration

Connect with popular tools and boost your productivity.

Shortcuts

Shortcuts

Shortcuts in an app developed by Apple and it allows you to create an automation. You can download our powerful Shortcut and you will be able to shorten links in a snap and save it directly in your account.

Know More
Zaiper

Zaiper

You can use Zapier to automate campaigns. By adding the URL to the zapier webhook, we will send you important information to that webhook so you can use them.

Know More

Start Your 3-Day Free Trial

We can help you to measure your Dream 🙂

Newsletter

Subscribe to our weekly/monthly newsletter and never miss our latest news, price drop alerts etc.,

Don’t worry we don’t spam.
Recut Subscription
recut_fav

Free URL shortener to create perfect URLs for your business. Recut helps you create and share branded links with your own custom domains at scale.

Copyright: © 2023. Recut URL Shortener. All Rights Reserved.