Add variables from rewrite rules to query var

I wasn’t linking to the page correctly in the rewrite rules. The use of pagename was incorrect instead I should have used page_id. The rewrite rules I ended up using was add_rewrite_rule(‘^resa/start/?$’, ‘index.php?page_id=1897&route_page=start’, ‘top’); add_rewrite_rule(‘^resa/planera/?$’, ‘index.php?page_id=1897&route_page=plan’, ‘top’); add_rewrite_rule(‘^resa/dela/([^/]+)/?$’,’index.php?page_id=1897&route_page=share&share_id=$matches[1]’, ‘top’);

WPGut – Updating failed and shortcode?

As Tom pointed out, the reason you are seeing that error is you shortcode is not returning your desired output, but rather outputting it right in place. This results in a breaking of the REST API and you seeing that error message. Simple fix: function register_form_template_f() { return ‘<h1>Hello World! register</h1>’; } add_shortcode(‘register_form_template’, ‘register_form_template_f’);