Full-Page Script in Veshort

Last Updated March 02, 2024

The Full-Page Script in Veshort is a powerful tool that allows you to easily shorten all or select URLs on your website. To implement this script, you simply need to copy and paste the code below at the end of your page. You can customize the selector as you wish to target URLs in a specific selector.

Here is an example of the basic code:


Choosing a different domain

If you want to use a different domain for your shortened URLs, you can define a custom domain name. Make sure the domain is exactly the same as the domain added in your Veshort account, including the schema (HTTP/HTTPS). Here is an example of how to define a custom domain:


Choosing custom selectors

You can also specify custom selectors to target specific URLs. Here is an example of how to use custom selectors:

This example will only shorten URLs that have a class named "mylink" or all direct link in the ".content" container or all links in the ".comments" container


Excluding domain names

You can also exclude specific domain names by using the exclude parameter. Here is an example of how to exclude certain domain names:

This example will shorten all URLs except URLs from google.com or apple.com


Restricting domain names

You can also restrict domain names by adding an include parameter. Here is an example of how to restrict domain names:

This example will shorten all URLs within the include domain name.

Please note that the key in the example is just a placeholder, you should use the key that you have been provided with  in your account.


Return to the documentation click Here