Title: check &#039;permalink_structure&#039; for trailing slashes
Last modified: August 22, 2016

---

# check 'permalink_structure' for trailing slashes

 *  [derniwi](https://wordpress.org/support/users/derniwi/)
 * (@derniwi)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/check-permalink_structure-for-trailing-slashes/)
 * Hi,
 * I use a custom permalink structure:
    `/%postname%` without a trailing slash. 
   But I get a problem on several pages using the “?lang=en” method for generating
   the translation links.
 * It would be nice if you could check if the function
    `get_option('permalink_structure')`
   returns a string with a trailing slash or not and append only a slash to the 
   URL if neccessary.
 * Currently I have changed the file
    `frontend\utils.php` so I can use the plugin.
 * Best regards
    Nils
 * [https://wordpress.org/plugins/ceceppa-multilingua/](https://wordpress.org/plugins/ceceppa-multilingua/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Alessandro Senese aka Ceceppa](https://wordpress.org/support/users/ceceppa/)
 * (@ceceppa)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/check-permalink_structure-for-trailing-slashes/#post-5213467)
 * Hi,
    thanks for suggestion.. . Can you post your edit so I can apply the patch?
 *  Thread Starter [derniwi](https://wordpress.org/support/users/derniwi/)
 * (@derniwi)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/check-permalink_structure-for-trailing-slashes/#post-5213482)
 * Hi,
 * I modified the function “cml_get_the_link()” in the file “frontend\utils.php”.
   Just replace “return $link;” with this code:
 *     ```
       // Get the last character from the permalink structure definition
         $permalink_structure = get_option('permalink_structure');
         if ( $permalink_structure !== '' ) {
           if ( substr( $permalink_structure, -1 ) != '/' ) {
             $link = untrailingslashit( $link );
           }
         }
   
         return $link;
       ```
   
 * Hope this is ok. 😉
 * Regards
    Nils
 *  Plugin Author [Alessandro Senese aka Ceceppa](https://wordpress.org/support/users/ceceppa/)
 * (@ceceppa)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/check-permalink_structure-for-trailing-slashes/#post-5213561)
 * Thanks 🙂

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘check 'permalink_structure' for trailing slashes’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/ceceppa-multilingua_4faedb.svg)
 * [Ceceppa Multilingua](https://wordpress.org/plugins/ceceppa-multilingua/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ceceppa-multilingua/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ceceppa-multilingua/)
 * [Active Topics](https://wordpress.org/support/plugin/ceceppa-multilingua/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ceceppa-multilingua/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ceceppa-multilingua/reviews/)

## Tags

 * [permalink](https://wordpress.org/support/topic-tag/permalink/)
 * [trailing slash](https://wordpress.org/support/topic-tag/trailing-slash/)

 * 3 replies
 * 2 participants
 * Last reply from: [Alessandro Senese aka Ceceppa](https://wordpress.org/support/users/ceceppa/)
 * Last activity: [11 years, 8 months ago](https://wordpress.org/support/topic/check-permalink_structure-for-trailing-slashes/#post-5213561)
 * Status: not resolved