You simply try below code to achieve your requirement. I hope it will work for you.
<button onclick="window.history.go(-1); return false;">Go Back</button>
Related Posts:
- get_posts empty when called via Ajax
- WordPress ajax get content post id
- Loading post template that contains a nested loop with ajax
- AJAX – get_posts for a specific post type returns empty
- How to get data with Select AJAX PHP
- Google Maps API throws “Uncaught ReferenceError: google is not defined” only when using AJAX
- Initialize TinyMCE editor / visual editor after AJAX insert
- Using Ajax with a Class file
- Displaying PHP Errors from admin-ajax.php
- wp_set_auth_cookie() doesn’t work in Ajax call
- WP-AJAX vs WP REST API: What to use for requests to the website from outside?
- Stop admin-ajax?
- Is it safe to assume that a nonce may be validated more than once?
- Using Nonces for AJAX that only retrieves data
- store/cache ajax sent data to avoid repeated request
- Trying to load content of a post via AJAX
- Insert Post using Ajax
- How can I automatically login using a URL?
- Run again current query via ajax but changing a var
- Quick Edit: Selected Custom Taxonomy Not Refreshing After Save
- wp_verify_nonce always returns false when logged in as admin
- fetching via fetch/ajax gutenberg block data from third party
- Ajax requests with different WordPress Address and Site Address setup
- Conditional action hooks
- is_home doesn’t affect content
- How to make get_theme_mod work with AJAX in the customizer preview
- How to check an ajax nonce in PHP
- jQuery Ajax passing empty parameters to my function?
- admin-ajax.php slows down, but cant figure out which plugin
- Convert this relative path to absolute
- Load WP content with ajax less server demanding and faster than normal page loading?
- admin-ajax.php slow website, how to fix
- WP Admin AJAX Security – using POST to include a relative URL
- Admin-ajax.php 400 error
- wp_create_nonce() in REST API makes user->ID zero
- Plugin: AJAX query external API to sync to tables
- How to create an ajax endpoint without js?
- AJAX Load more on CPT returning random posts
- WordPress admin-ajax.php not available for subscribers/contributors
- WP Ajax never returning any data / calling action
- get_queried_object_id in AJAX
- Should I check for privileges before hooking into `wp_ajax_$handle` or after?
- Refresh Markercluster after ajax call
- Making an ajax request from a different domain
- Mapping Backbone Models to serialized array in wp_options table
- WordPress Settings api data not sanitized if i use ajax
- Images loading over http instead of https
- Ajax login without redirect/reload
- wp_mail 200 response but no mail sent
- Ajaxify Form That Submits To Same Page To Display Post Data [closed]
- wp_ajax_ works fine but wp_ajax_nopriv_ returns HTML and not calling function
- Why is wp_localize_script returning false?
- Change header.php after ajax call
- Retrieve JSON file from JS trough php
- WordPress – admin-ajax.php returns 502 Bad Gateway [closed]
- Using admin-ajax prevents regular php form submission
- Sql formatting for post data within function
- Get returned URL from wp_remote_post if response code is 302
- Change URL without reload Ajax
- Hide Load more Ajax button if there is no more users to load or less than the number?
- Send checkbox status with Ajax / JSON and save it
- ajax refresh to display new posts
- wp ajax execution time aborted 30 sec
- How to get setting from separate file?
- Contact form – ajax, wp_mail
- WordPress function not defined in AJAX call
- admin-ajax.php calls fail if referrer is sent with 500
- Fetch value using AJAX in WordPress
- AJAX not working when clicking load more button, when two terms are present in tax_query
- Can I use application/json content type in WordPress
- What is the relationship between UFW (firewall) being enabled and cron job running?
- WPBakery post content inside Bootstrap Modal
- error_log() not working within wp_ajax_{action} handler
- Hook after all metadata are set is triggering several time
- check_ajax_reffer not working when logged
- Assign author on ajax wp post insert
- Ajax a php file that has Advanced Custom Fields in it
- AJAX is not submitting data to database
- Ajax show custom post data form & script
- Create a post with REST API and adding a category
- how to correctly use json_encode with ajax
- How to trigger lost password email using REST API?
- Using AJAX on Contact-form the WordPress way
- Retrieve Header Background Image with AJAX
- How to block search engines indexing certain AJAX actions
- AJAX call in backend results in empty update_option
- Ajax Comment: Page reloads whenever the comment submission form is reloaded
- wp_ajax_action, wp_ajax_nopriv_action not working
- get_comments() returns empty array if called through AJAX
- Manually cache a special, non-WP-but-using-WP page (e.g. Ajax results) with W3TC
- How to get parent comment’s id?
- Static var overwritten with WP AJAX action, works fine without AJAX
- using ajax to query sql
- Dynamic dependent select box getting null value
- Add “load more” functionality to an AJAX response
- weird Internal Server Error – no error log produced
- Why are the most recent posts not appearing in a fetch request, unless I’m logged in?
- Successful ajax call returns lots of whitespace and text of code with 0
- How to submit a button automatically after every scheduled hours?
- At what stage does wp_ajax hooks gets applied during WordPress request?