Back Button Anywhere Widget for WordPress adds a one-click “Back” button to any WordPress site through a widget, a shortcode or a PHP function, and in Pro through a menu item or a floating button. Its settings page is at WPFactory > Back Button, and the widget itself is under Appearance > Widgets.
What it does #
Back Button Widget outputs a button or text link that sends the visitor to the previous page in their browser history. It works on any WordPress site and does not need WooCommerce or a page builder.
Install and activate #
- Free: go to Plugins > Add New, search for Back Button Widget by WPFactory, click Install Now, then Activate.
- Pro: download Back Button Widget Pro from your WPFactory account, go to Plugins > Add New > Upload Plugin, upload the ZIP and activate it.
- You can leave the free plugin installed. When Pro is active, the free copy stops loading on its own, so the two never run together.
For more detail, see Installing the Back Button Widget plugin.
First setup #
The fastest working result is the widget or the shortcode. Both are free.
- Go to Appearance > Widgets and add the Back Button widget to a sidebar, footer or any widget area.
- Set Button label (default: Back) and, if you want a plain link instead of a button, set Button type to Simple text (default: Button).
- Save the widget and open a page on your site from another page to test it.
- To place the button inside content instead, add
[alg_back_button]to a post or page, or[alg_back_button label="Go back"]for a custom label. In a theme template, useecho alg_back_button( 'Back' );.
Widget fields #
| Field | Instance key | Default | Free/Pro |
|---|---|---|---|
| Title | title |
Empty | Free |
| Before button | before_button |
Empty | Free |
| After button | after_button |
Empty | Free |
| Button label | button_label |
Back | Free |
| Button HTML class | button_class |
Empty | Free |
| Button HTML style | button_style |
Empty | Free |
| Button type | button_type |
Button | Free |
| Button JS function | button_js_func |
back | Free |
| Hide on front page | hide_on_front_page |
No | Pro |
| Hide on URL param / value | hide_on_url_param |
Empty | Pro |
Button type chooses how the button is rendered: Button outputs an <input type="button">, and Simple text outputs a plain text link. Button JS function chooses the browser call: back runs history.back() and go(-1) runs history.go(-1); both return to the previous page. All widget options are covered in the Back Button Widget settings reference.
Main features #
Shortcode and attributes (Free) #
[alg_back_button] accepts the widget settings as attributes, such as label, class, style, type and js_func, plus before and after. See the shortcode attributes reference and the shortcodes guide.
Font Awesome icon (Free) #
Add an icon with the fa attribute, for example [alg_back_button fa="fas fa-angle-double-left"]. If your theme does not load Font Awesome, turn on Load in the Font Awesome section of the settings page. See how to add a Font Awesome icon to the back button.
Translated labels (Free) #
The lang and not_lang_text attributes and the [alg_back_button_translate] shortcode show a different label per language. They read the WPML language code (ICL_LANGUAGE_CODE), which Polylang also provides. See how to translate the back button.
Menu button (Pro) #
In Menu Options, set Enable section to Yes and pick Menu location(s) or Menu(s). The button is added as the last item. See how to add the back button to a WordPress menu.
Floating button (Pro) #
In Floating Button Options, set Enable section to Yes and choose a Position (Bottom right, Bottom left, Top right or Top left) and margins. See how to add a floating back button.
Hide or show rules (Pro) #
Hide the button on the front page, or hide or show it based on a URL parameter, from the widget or with shortcode attributes such as hide_on_front_page and show_on_url_param. See how to hide or show the back button by page or URL.
Free vs Pro #
| Feature | Free | Pro |
|---|---|---|
| Back Button widget (label, class, style, type, JS function) | Yes | Yes |
[alg_back_button], [alg_back_button_translate] and alg_back_button() |
Yes | Yes |
| Font Awesome icon and loader | Yes | Yes |
| Menu Options (button in a menu) | No | Yes |
| Floating Button Options | No | Yes |
| Hide on front page, hide or show by URL parameter | No | Yes |
For a longer comparison, see Back Button Widget: Free vs Pro.
FAQ #
Where are the settings? #
At WPFactory > Back Button (page title “Back Button Settings”), with sections for Widget, Shortcode, Menu Options, Floating Button Options and Font Awesome. The widget’s own fields are edited in Appearance > Widgets.
Why does the button do nothing on some pages? #
The button repeats the browser’s back action, so it only works when there is a previous page in the visitor’s history. Someone who lands directly on the page from an external link or a new tab has nothing to go back to. For a fixed destination, use a normal link. See back button navigation behavior.
Does it need WooCommerce? #
No. It is a WordPress plugin and works on any site.
Why are the Menu and Floating Button options greyed out? #
Those sections are Pro. On the free version their controls are disabled and show a note that Back Button Widget Pro is required.
The button is not showing. What should I check? #
See Back Button not showing or working.
Get more control #
The widget, shortcode and PHP function are free. Back Button Anywhere Widget for WordPress Pro adds menu placement, a floating button and hide or show rules. See what Pro unlocks.
Need a hand? Our team answers every ticket on the Back Button Widget support forum.
