Convert Input Text Into Search Engine Friendly URLs - jquery-slug.js

File Size: 7.39 KB
Views Total: 372
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   
Convert Input Text Into Search Engine Friendly URLs - jquery-slug.js

Yet another SEO-friendly URL slug generator that converts input text (e.g., post titles) into a clean, readable, and search engine friendly URL. This can help improve search engine visibility and ranking for the page.

Features:

  • No spaces or special characters
  • Lowercase letters
  • Short, concise URL paths
  • Custom prefix.

See Also:

How to use it:

1. Download and add the jquery-slug.js script to the webpage.

<script src="/path/to/cdn/jquery.slim.min.js"></script>
<script src="/path/to/jquery-slug.min.js"></script>

2. Provide two text input fields. One allows users to input content, such as article titles, while the other holds the generated URL slug.

<h3>Blog Title</h3>
<input id="title"  />

<h3>URL Slug</h3>
<input id="url"  />

3. Initialize the plugin and add a prefix to the URL slug.

$("#title").mirror({
  prefix: 'https://www.jqueryscript.net/',
  output: '#url',
});

4. More configuration options.

$("#title").mirror({

  // 'uppercase', ...
  textTransform: "lowercase",
  
  // make the output input disabled
  outputDisabled: false,

  // make the URL slug more SEO friendly
  seoURL: true,
  
});

This awesome jQuery plugin is developed by Pradnyana28. For more Advanced Usages, please check the demo page or visit the official website.