To improve SEO, we need to clean our URLs. By default in drupal, we've an option called clean URLs at the configuration. In drupal 7, we can also manage the URLs. For instance, you have a content type called services. You wanted to each service page have url like services/page-name. To do that, we've a pathauto module in drupal 7. The pathauto module allow us to manage the URLs for every content types, files, taxonomy & users and also we can remove some unnecessary words from URL like an, the and so on.
The pathauto module can remove some unnecessary words like a, an, the and so on & also remove special characters like !, @, $ and so on. Unfortunately, it doesn't included some other symbols like copyright(©), trademark(™), registered(®) and so on. But it provide a hook to add new symbols into the punctuation settings called hook_pathauto_punctuation_chars_alter. After created a content with some symbols which are represented above, your page URL looks like below image:
After implemented above code into your module, you cold see added symbols are listing on Pathauto module's settings page at /admin/config/search/path/settings. If You didn't get these symbols, clear cache & test it again. It looks like below image:
Now you can create a content with those symbols. The pathauto module didn't added those symbols into the URL.
Now I hope you know how to remove some special characters from URL alias using pathauto module in drupal 7.
The pathauto module can remove some unnecessary words like a, an, the and so on & also remove special characters like !, @, $ and so on. Unfortunately, it doesn't included some other symbols like copyright(©), trademark(™), registered(®) and so on. But it provide a hook to add new symbols into the punctuation settings called hook_pathauto_punctuation_chars_alter. After created a content with some symbols which are represented above, your page URL looks like below image:
/**
* Implements hook_pathauto_punctuation_chars_alter().
*/
function phponwebsites_pathauto_punctuation_chars_alter(array &$punctuation) {
$punctuation['copyright'] = array('value' => '©', 'name' => t('Copyright'));
$punctuation['registered'] = array('value' => '®', 'name' => t('Registered trademark'));
$punctuation['trademark'] = array('value' => '™', 'name' => t('Trademark'));
}
* Implements hook_pathauto_punctuation_chars_alter().
*/
function phponwebsites_pathauto_punctuation_chars_alter(array &$punctuation) {
$punctuation['copyright'] = array('value' => '©', 'name' => t('Copyright'));
$punctuation['registered'] = array('value' => '®', 'name' => t('Registered trademark'));
$punctuation['trademark'] = array('value' => '™', 'name' => t('Trademark'));
}
After implemented above code into your module, you cold see added symbols are listing on Pathauto module's settings page at /admin/config/search/path/settings. If You didn't get these symbols, clear cache & test it again. It looks like below image:
Now you can create a content with those symbols. The pathauto module didn't added those symbols into the URL.
Now I hope you know how to remove some special characters from URL alias using pathauto module in drupal 7.
Related articles:
Add new menu item into already created menu in Drupal 7
Add class into menu item in Drupal 7
Create menu tab programmatically in Drupal 7
Add custom fields to search api index in Drupal 7
Clear views cache when insert, update and delete a node in Drupal 7
Create a page without header and footer in Drupal 7
Login using both email and username in Drupal 7
How to set multiple URL alias for a node using pathauto module in Drupal 7
Update multiple fields using #ajax in Drupal 7
Add new menu item into already created menu in Drupal 7
Add class into menu item in Drupal 7
Create menu tab programmatically in Drupal 7
Add custom fields to search api index in Drupal 7
Clear views cache when insert, update and delete a node in Drupal 7
Create a page without header and footer in Drupal 7
Login using both email and username in Drupal 7
How to set multiple URL alias for a node using pathauto module in Drupal 7
Update multiple fields using #ajax in Drupal 7
An alternative solution would be to use the Transliteration module (https://www.drupal.org/project/transliteration)
ReplyDeleteWe understand that with the described methods for 192.168.0.1 configuration is usually a bit complicated for people. In the event you have some complications signing in just contact the support team of the router company. We're the group if technology experts who are providing the solutions for 192.168.0.l set up as well as 192.168.0.1 Administrative connection for a long time.
ReplyDeleteVery useful info, thanks
ReplyDeleteVery useful info, thanks
ReplyDeleteThanks for information
ReplyDeletevery useful info
ReplyDeletewonderful post
ReplyDeleteVery nice
ReplyDeleteI like your all post
ReplyDeleteuseful information for all
ReplyDeletevery well
ReplyDeletehttps://www.buyyoutubesubscribers.in/ Ever since the advent of video games, there have been debates on the pros and cons of gaming. While there is no denial that gaming sharpens a number of skills of the child, it also stands for a fact that the addiction of gaming can have dire health consequences. Apart from health risks, an addiction to gaming also brings along a non-social temperament that leads to stalled emotional growth.
ReplyDelete