---
title: "Back Button Widget: Shortcodes Guide"
description: "The two Back Button Widget shortcodes: [alg_back_button] to show the button and [alg_back_button_translate] for language-specific text."
url: "https://wpfactory.com/docs/shortcodes-guide-back-button/"
updated: "2026-10-05"
category: Shortcodes
tags:
  - Back Button Widget for WordPress
---

# Back Button Widget: Shortcodes Guide

[Back Button Anywhere Widget for WordPress](https://wpfactory.com/item/back-button-widget-wordpress-plugin/) registers two shortcodes you can use anywhere on your WordPress site: `[alg_back_button]` to output the button, and `[alg_back_button_translate]` to show language-specific text. Both are available in the free version.

[![Back Button Widget shortcode used on a WordPress page](https://wpfactory.com/wp-content/uploads/82325c98-392b-4f54-8ab2-46cc4ea3fb38-1024x488.jpg)](https://wpfactory.com/wp-content/uploads/82325c98-392b-4f54-8ab2-46cc4ea3fb38.jpg)

**Menu and floating buttons are not shortcodes.** There is no `[alg_back_button_menu]` or `[alg_back_button_floating]` tag. Menu placement and the floating button are Pro settings under **WPFactory > Back Button**, in the Menu Options and Floating Button Options sections.

### [alg_back_button]

Outputs a "Back" control that returns the visitor to the previous page. Use it in posts, pages, widgets, or template files.

```
[alg_back_button label="Go back"]
```

Attributes:

| Attribute | Default | Effect |
| --- | --- | --- |
| `label` | Back | Button text. |
| `type` | input | `input` = a form button, `simple` = a text link, `href` = returns the bare `javascript:history.back()` URL for use in a link. |
| `class` | Empty | Extra CSS class(es) on the button. |
| `style` | Empty | Inline CSS, for example `background-color:#007BFF;color:#fff;` |
| `js_func` | back | `back` runs `history.back()`, `go` runs `history.go(-1)`. Both go back one page. |
| `fa` | Empty | Font Awesome class, for example `fas fa-angle-double-left`. Setting this renders the button as a simple text link with the icon. |
| `fa_template` | `%icon%` | Where the icon sits. Use `%icon% Back` to show icon plus text. |
| `before` | Empty | Text or HTML added before the button. |
| `after` | Empty | Text or HTML added after the button. |
| `lang` | Empty | Language code(s). Used with `not_lang_text` to swap the label off that language. |
| `not_lang_text` | Empty | Label shown when the active language is not in `lang`. |

Example with an icon and inline style:

```
[alg_back_button label="Go Back" fa="fas fa-arrow-left" fa_template="%icon% %label%" style="padding:10px 20px;"]
```

[![Back Button Widget shortcode with a Font Awesome icon](https://wpfactory.com/wp-content/uploads/1079b576-9e4f-4950-8a93-552f7c0a3532-1024x460.jpg)](https://wpfactory.com/wp-content/uploads/1079b576-9e4f-4950-8a93-552f7c0a3532.jpg)

### [alg_back_button_translate]

Shows different text depending on the active site language (WPML or Polylang, read from `ICL_LANGUAGE_CODE`). It has two forms.

**Self-closing form** needs all three of `lang`, `lang_text`, and `not_lang_text`:

```
[alg_back_button_translate lang="FR" lang_text="Retour" not_lang_text="Back"]
```

**Enclosing form** wraps the text and shows it only for the matching language, or for everything except an excluded list:

```
[alg_back_button_translate lang="FR"]Retour[/alg_back_button_translate]
[alg_back_button_translate lang="DE"]Zurück[/alg_back_button_translate]
[alg_back_button_translate not_lang="FR,DE"]Back[/alg_back_button_translate]
```

Because `[alg_back_button]` runs shortcodes inside its `label`, you can combine the two: put a translate shortcode in the label to localize the button text. See [How to translate the back button](https://wpfactory.com/docs/translate-the-back-button/) for full examples.

### Get more control

The shortcodes are free. [Back Button Anywhere Widget for WordPress](https://wpfactory.com/item/back-button-widget-wordpress-plugin/) Pro adds the button to your menus, a floating button, and hide/show rules, all from the settings screen. [See what Pro unlocks](https://wpfactory.com/item/back-button-widget-wordpress-plugin/).

Related articles

- [Back Button Widget Settings Reference](https://wpfactory.com/docs/back-button-widget-settings-reference/)
- [Back Button Shortcode Attributes Reference](https://wpfactory.com/docs/back-button-shortcode-attributes-reference/)
- [Back Button Widget Issues with Custom or Block Themes](https://wpfactory.com/docs/back-button-widget-theme-issues/)
- [Back Button Widget: Additional Tips](https://wpfactory.com/docs/additional-tips-back-btn/)
- [Back Button Widget Troubleshooting](https://wpfactory.com/docs/back-button-slug/)

 

[![Back Button Widget for WordPress](https://wpfactory.com/wp-content/uploads/Back-Button-Widget.webp)](https://wpfactory.com/item/back-button-widget-wordpress-plugin/)
