WPML
Status
Resolved
Reported for
WPForms Multilingual 0.3.6
Resolved in
WPForms Multilingual 0.4.0
Related plugin/theme
WPForms
Topic tags
Compatibility

Overview of the issue

If you are using WPForms and its WPForms Form Pages addon, you may encounter a 404 error when accessing form pages in secondary languages with a custom permalink structure (e.g., /artikel/%postname%/).

Workaround

Please, make sure of having a full site backup of your site before proceeding.


  • Open …/wp-content/plugins/wpforms-form-pages/src/Frontend.php file.

  • Look for line 78.

  • Replace:
    			$request = ! empty( $request ) ? sanitize_key( wp_parse_url( $request, PHP_URL_PATH ) ) : '';

  • With:
    			if ( ! empty( $request ) ) {
    				// Parse the URL to get the path component
    				$path = wp_parse_url( $request, PHP_URL_PATH );
    		
    				// Use a regular expression to remove the language segment (e.g., "/en/") from the path
    				// This pattern assumes the language code is always two characters and follows the first "/"
    				$path = preg_replace( '#^/([a-zA-Z]{2})/#', '/', $path );
    		
    				// Sanitize the resulting path
    				$request = sanitize_key( $path );
    			} else {
    				$request = '';
    			}

All known issues →