Updated: 07/12/2022

Published: 24/08/2020

By Peter K

Has Elementor got you stumpped?

A recent update with WordPress 5.5 caused the pagination in the post widget in elementor to break. 

URLS are displaying /2/ instead of /page/2/

A quick solution is to use Javascript to add the /page into the url.

Use the html widget

On the page where the problem is occuring, use the html widget.

Copy and paste the following code


   jQuery('a.page-numbers').each(function(index) { 
   var oldUrl = jQuery(this).attr('href'); 
  // alert("test: "+oldUrl);
   var patt = /\/[0-9]\//;
   var result = oldUrl.match(patt);
   var result2 = '/page' +result;
   url = oldUrl.replace(result, result2);

    jQuery(this).attr('href', url); }); 


How to debug 

If you run into any problems, uncomment the line (remove the double forward slashes).

  // alert("test: "+oldUrl);

You can replace the +oldUrl variable with other variables to see what results appear.

Other solutions 

You can find more solutions on github