Title: Related Posts by Taxonomy
Author: keesiemeijer
Published: <strong>10. mai, 2013</strong>
Last modified: 22. januar, 2026

---

Søk i utvidelser

![](https://ps.w.org/related-posts-by-taxonomy/assets/banner-772x250.jpg?rev=711731)

![](https://ps.w.org/related-posts-by-taxonomy/assets/icon.svg?rev=1115231)

# Related Posts by Taxonomy

 Av [keesiemeijer](https://profiles.wordpress.org/keesiemeijer/)

[Last ned](https://downloads.wordpress.org/plugin/related-posts-by-taxonomy.2.7.8.zip)

 * [Detaljer](https://nb.wordpress.org/plugins/related-posts-by-taxonomy/#description)
 * [Omtaler](https://nb.wordpress.org/plugins/related-posts-by-taxonomy/#reviews)
 *  [Installering](https://nb.wordpress.org/plugins/related-posts-by-taxonomy/#installation)
 * [Utvikling](https://nb.wordpress.org/plugins/related-posts-by-taxonomy/#developers)

 [Brukerstøtte](https://wordpress.org/support/plugin/related-posts-by-taxonomy/)

## Beskrivelse

Quickly increase your readers’ engagement by adding related posts in the sidebar
or after post content with a widget or shortcode.

Posts with the **most terms in common** will display at the top!

This plugin is capable of finding related posts in multiple **taxonomies** and **
post types**. Include or exclude terms from the search for related posts. Change
the look and feel by using your own templates in a (child) theme.

[plugin documentation](http://keesiemeijer.wordpress.com/related-posts-by-taxonomy/)

Plugin features:

 * Widget and Shortcode.
 * Display related posts as **post thumbnails**, links, excerpts or full posts.
 * **Small Footprint**. Doesn’t slow down your site!
 * Automatic display of related posts after the post content.
 * **Exclude** or **include** terms and posts.
 * Search for related posts in single or multiple **taxonomies** and **post types**.
 * Limit the search for related posts by date, number or post meta.
 * Use your own **HTML templates** for display of the related posts.
 * Extensive [plugin documentation](http://keesiemeijer.wordpress.com/related-posts-by-taxonomy/).
 * Follows WordPress coding standards and plugin best practices.
 * Highly Adjustable!

For the following features you need to be somewhat familiar with WordPress [hooks](https://developer.wordpress.org/plugins/hooks/).
The [plugin documentation](http://keesiemeijer.wordpress.com/related-posts-by-taxonomy/)
has many examples to help you along.

Extended features:

 * Use a persistent cache for the related posts query. (opt-in feature)
 * Use the **WordPress REST API** to get related posts. (opt-in feature)
 * Load related posts after the whole page has loaded (with Ajax). (opt-in feature)
 * Use **plugin functions** in your theme templates to display related posts yourself.
 * Use Filters to **change the default behavior** of the plugin.

Follow this plugin on [GitHub](https://github.com/keesiemeijer/related-posts-by-taxonomy).

Search the [code reference](https://keesiemeijer.github.io/related-posts-by-taxonomy)

See the [FAQ](https://wordpress.org/extend/plugins/related-posts-by-taxonomy/faq/)
to have related posts automatically display after the post content without using
the shortcode or widget.

Default usage for the shortcode is:

    ```
    [related_posts_by_tax]
    ```

Attributes for the shortcode are:

 * `post_id`
 * `taxonomies`
 * `post_types`
 * `posts_per_page`
 * `order`
 * `orderby`
 * `before_shortcode`
 * `after_shortcode`
 * `title`
 * `show_date`
 * `before_title`
 * `after_title`
 * `include_terms`
 * `include_parents`
 * `include_children`
 * `exclude_terms`
 * `exclude_posts`
 * `format`
 * `gallery_format`
 * `image_size`
 * `columns`
 * `caption`
 * `link_caption`
 * `limit_posts`
 * `limit_month`
 * `meta_key`
 * `meta_value`
 * `meta_compare`
 * `meta_type`
 * `public_only`
 * `include_self`
 * `post_class`

Example to show 10 related posts instead of the default 5.

    ```
    [related_posts_by_tax posts_per_page="10"]
    ```

See the [documentation](https://keesiemeijer.wordpress.com/related-posts-by-taxonomy/#shortcode)
for more information about these attributes.

#### Oversettelser

 * Dutch
 * French (by [Annie Stasse](http://www.artisanathai.fr))
 * Spanish (by [Ludobooks – Cuentos personalizados](http://www.ludobooks.com))
 * Catalan (by [Ludobooks – Cuentos personalizados](http://www.ludobooks.com))
 * Polish (by [koda0601](http://rekolekcje.net.pl))

## Skjermbilder

 * [[
 * The Widget
 * [[
 * Twenty Fifteen screenshot. Related posts in the sidebar and after post content
 * [[
 * Twenty Twelve screenshot. Post thumbnails (after post content) and the widget
 * [[
 * Twenty Thirteen screenshot. Post thumbnails (after post content) and the widget

## Installasjon

 * Unzip the `related-posts-by-taxonomy.zip` folder.
 * Upload the `related-posts-by-taxonomy` folder to your `/wp-content/plugins` directory.
 * Activate _Related Posts by Taxonomy_.
 * That’s it, now you are ready to use the widget and shortcode

## Ofte stilte spørsmål

For more information about the plugin see the [plugin documentation](http://keesiemeijer.wordpress.com/related-posts-by-taxonomy/).

To customize this plugin see the [plugin recipes page](https://keesiemeijer.wordpress.com/related-posts-by-taxonomy/recipes/).

### Can I change the layout for the related posts?

Yes. Review [this section](https://keesiemeijer.wordpress.com/related-posts-by-taxonomy/recipes/#styling)
of the documentation to style the related posts yourself.

### How can I automatically add related posts after the post content?

Review [Adding Related Posts After the Post Content](http://keesiemeijer.wordpress.com/related-posts-by-taxonomy/#after-content).

### Can I include or exclude posts or terms with the widget or shortcode

Yes. For the widget see [this filter](http://keesiemeijer.wordpress.com/related-posts-by-taxonomy/filters/#related_posts_by_taxonomy_widget_args)
and for the shortcode see the attributes [include_terms](https://keesiemeijer.wordpress.com/related-posts-by-taxonomy/#include-terms),
[exclude-terms](https://keesiemeijer.wordpress.com/related-posts-by-taxonomy/#exclude-terms)
and [exclude_posts](https://keesiemeijer.wordpress.com/related-posts-by-taxonomy/#exclude-posts).

### Can I set my own defaults for the shortcode?

Yes. Review [Setting your own defaults for the shortcode](https://keesiemeijer.wordpress.com/related-posts-by-taxonomy/recipes/#shortcode_defaults)

### The widget only lets you choose «all taxonomies» or a single taxonomy. Can I make it use multiple specific taxonomies?

Yes. See [this filter](http://keesiemeijer.wordpress.com/related-posts-by-taxonomy/filters/#related_posts_by_taxonomy_widget_args)
on how to do that.

### Is this plugin GDPR compliant?

 * This plugin doesn’t process, share, send or retain any user data.
 * This plugin doesn’t track (user) data for analytics (or for any other reason).
 * This plugin doesn’t save or read cookies.
 * This plugin doesn’t use 3rd party libraries.

Read [this article](https://developer.wordpress.org/plugins/wordpress-org/compliance-disclaimers/)
why plugin authors cannot guarantee 100% compliance.

Please contact a GDPR consultant or law firm with this information to assess if 
this plugin is compliant.

## Vurderinger

![](https://secure.gravatar.com/avatar/a4babfd10111b95936a6bea8d17e03f91cc74cc6f0a0654a3c120f2199d114d5?
s=60&d=retro&r=g)

### 󠀁[Plugin fantastico!](https://wordpress.org/support/topic/plugin-fantastico-38/)󠁿

 [Betty_](https://profiles.wordpress.org/betty_/) 22. januar, 2026

Adoro questo plugin, funziona alla grande e ha molte funzionalità! Il supporto è
fantastico! Grazie di cuore!

![](https://secure.gravatar.com/avatar/3de8e6edcf185d6c255520f36b8278bb217737edb440adba91c5f68d580274db?
s=60&d=retro&r=g)

### 󠀁[My goodness!](https://wordpress.org/support/topic/my-goodness/)󠁿

 [Gaurav Tiwari](https://profiles.wordpress.org/gauravtiwari/) 9. desember, 2024

How on the Earth did I miss this related posts plugin? Maybe the name is too niche
but it is a wonderful «allrounder» plugin. A six-stars out of five — tool. Rocking
it on my primary website and soon to be added to all my client sites. Very well 
done and thanks for the documentation. Helps a fellow developer.

![](https://secure.gravatar.com/avatar/9951b8075158948825743d44f46c7108908b0e75a779b553705a51d770dcac91?
s=60&d=retro&r=g)

### 󠀁[Always a pleasure to use](https://wordpress.org/support/topic/always-a-pleasure-to-use/)󠁿

 [SomniumLucidus](https://profiles.wordpress.org/somniumlucidus/) 1. september, 
2023

After having repeatedly tried and dumped a heap of plugins that didn’t quite do 
what they should—or needed convoluted work in order to do so—, what a relief it 
is to finally installing this plugin! I was wondering why I had chosen this one 
for a previous website I put together a while ago, and now I understand.

![](https://secure.gravatar.com/avatar/9c6152565ca43169927c69d55de001ee75a7e3491ee02bd258f4129333f0646b?
s=60&d=retro&r=g)

### 󠀁[A moment of silence for a once great plugin…](https://wordpress.org/support/topic/a-moment-of-silence-for-a-once-great-plugin/)󠁿

 [laceybeach](https://profiles.wordpress.org/laceybeach/) 10. juli, 2022

I enjoyed RPbT while it worked. It used to be a 5 star plugin. But it seems to have
finally wilted, ceased to be and is now an ex-plugin. Rest in Plugin-heaven

![](https://secure.gravatar.com/avatar/a6e9d04f4e159bd89fcb5750c055915b8f3bc522b507905db294dba20f47a4d8?
s=60&d=retro&r=g)

### 󠀁[Great Plugin!](https://wordpress.org/support/topic/great-plugin-33598/)󠁿

 [](https://profiles.wordpress.org/zignorp/) 3. mars, 2022

I love that this plugin does exactly what I need it to do, the attributes are easily
edited and you’re really thought of anything I would want to specify. I really like
that it’s so lightweight and simple, I had given up on using these plugins a few
years back because of the load on larger sites. I hope it gets updated if there 
are any issues with new versions of wp, but for me, it’s working great with 5.9.1(
classic admin) Thank you!

![](https://secure.gravatar.com/avatar/7e3c93d1b8a9810341a539baf3c977b169db28971525b185a7fca1abddd499e6?
s=60&d=retro&r=g)

### 󠀁[Light Related Posts plugin for WordPress](https://wordpress.org/support/topic/light-related-posts-plugin-for-wordpress/)󠁿

 [SamX](https://profiles.wordpress.org/techlector/) 20. april, 2021

This is one of the best related post plugins I have on my Wordpress site. it is 
fast in loading and highly customizable. I found this as the best alternative to
the heavy jetpack related post that lacks many features; one which is to lazyload
related post images, and it can make use of your already cropped images (300 x 250)
instead of using the full-sized images.

 [ Les alle 77 vurderinger ](https://wordpress.org/support/plugin/related-posts-by-taxonomy/reviews/)

## Bidragsytere og utviklere

«Related Posts by Taxonomy» er programvare med åpen kildekode. Følgende personer
har bidratt til denne utvidelsen:

Bidragsytere

 *   [ keesiemeijer ](https://profiles.wordpress.org/keesiemeijer/)

«Related Posts by Taxonomy» har blitt oversatt til 7 språk. Takk til [oversetterne](https://translate.wordpress.org/projects/wp-plugins/related-posts-by-taxonomy/contributors)
for deres bidrag.

[Oversett «Related Posts by Taxonomy» til ditt språk.](https://translate.wordpress.org/projects/wp-plugins/related-posts-by-taxonomy)

### Interessert i utvikling?

[Bla gjennom koden](https://plugins.trac.wordpress.org/browser/related-posts-by-taxonomy/),
sjekk ut [SVN-repositoriet](https://plugins.svn.wordpress.org/related-posts-by-taxonomy/),
eller abonner på [utviklingsloggen](https://plugins.trac.wordpress.org/log/related-posts-by-taxonomy/)
med [RSS](https://plugins.trac.wordpress.org/log/related-posts-by-taxonomy/?limit=100&mode=stop_on_copy&format=rss).

## Endringslogg

#### 2.7.8

 * Bug Fixes
    - Fix gallery tags being stripped from html output

#### 2.7.7

 * Bug Fixes
    - Use wp_kses() to sanitize the html output of the shortcode, widget and rest
      api features

#### 2.7.6

 * Enhancement
    - Add a filter to use any theme directory for custom related posts template 
      files

#### 2.7.5

 * Enhancement
    - Fix PHP 8 and up deprecated notices

#### 2.7.4

 * Enhancement
    - Update the block gallery with the HTML changes made in WordPress 5.4 (again!).
    - Use post title for aria-label only
    - Display cache log in footer (because admin_bar_menu hook changed to wp_body_open)
    - Getting ready for WP 5.5 (updating deprecated functions)

#### 2.7.3

 * Enhancement
    - Make the no posts found message filterable.
    - Update gallery with the HTML changes made in the WordPress 5.3 gallery.
    - Add accessibility to the gallery item element.
 * Deprecated
    - The ‘terms’ and ‘related’ arguments are deprecated in favor of the ‘include_terms’
      argument.
       * The ‘include_terms’ argument now uses the included terms without any restrictions.
       * The default value for the ‘related’ argument changed from boolean true 
         to null.
       * Set the ‘related’ argument to boolean true to have the old restrictions
         back.

#### 2.7.2

 * Bug Fixes
    - Fix for gallery image (fallback) filter not being reached.
    - Sanitize Rest API rendered HTML with wp_kses_post().

#### 2.7.1

 * Enhancement
    - New format for related galleries similar to the Gutenberg gallery block.
    - Include child or parent terms for the related posts query.
    - Filters for Widget defaults and instance.
 * Bug Fixes
    - (minor) Don’t default to all public taxonomies if no valid taxonomies are 
      used.

#### 2.6.0

 * Enhancement
    - Meta query
       * Allows you to query related posts with post meta
       * Use meta arguments in the shortcode
       * Use a filter for the widget or for complex meta queries
    - ID query
       * Allow queries for post IDs only. (for the related posts in the widget and
         shortcode templates)
       * Speeds up the related posts query. (not activated by default because of
         back compatibility)
       * Please read the documentation about query optimization before using this
         feature
    - Lazy loading (opt in feature).
       * Speeds up perceived page load time for very large sites
       * Does the query for related posts (with Ajax) after the page is loaded
       * Recommended for related posts below the fold.
    - Detect post type Page taxonomies
    - Preparing the plugin for the (Gutenberg) editor block feature

#### 2.5.1

 * Enhancement
    - Add ability to show the post date after the post title
    - Allow getting post fields from the cache
    - Add new filter to filter all related post permalinks
    - Add new tests for the post type feature (GitHub)
 * Bug fixes
    - (minor) Add post classes after retrieving posts from the cache
    - (minor) Return an error if invalid taxonomies or post types was requested 
      with the WP Rest API

#### 2.5.0

 * Enhancement
    - Prepare plugin for gutenberg blocks
    - Add ‘terms’ parameter for shortcode and widget
    - Add GDPR information to readme.txt
    - deprecate functions (with back compatibility)
       * km_rpbt_related_posts_by_taxonomy()
       * km_rpbt_get_default_args()
       * km_rpbt_related_posts_by_taxonomy_validate_ids()
       * km_rpbt_related_posts_by_taxonomy_template()
       * km_rpbt_post_title_link()
       * km_rpbt_get_related_post_title_link()
       * km_rpbt_related_posts_by_taxonomy_widget()
 * Bug fixes
    - (minor) Add missing filter pre_related_posts before cache queries
    - (minor) Add missing properties to related posts returned by the cache

For older changelog versions see the changelog.txt file

## Meta

 *  Versjon **2.7.8**
 *  Sist oppdatert **3 måneder siden**
 *  Aktive installasjoner **10 000+**
 *  WordPress-versjon ** 5.9 eller nyere **
 *  Testet opp til **6.9.4**
 *  Språk
 * [Basque](https://eu.wordpress.org/plugins/related-posts-by-taxonomy/), [Chinese (China)](https://cn.wordpress.org/plugins/related-posts-by-taxonomy/),
   [Chinese (Taiwan)](https://tw.wordpress.org/plugins/related-posts-by-taxonomy/),
   [Dutch](https://nl.wordpress.org/plugins/related-posts-by-taxonomy/), [English (Canada)](https://en-ca.wordpress.org/plugins/related-posts-by-taxonomy/),
   [English (US)](https://wordpress.org/plugins/related-posts-by-taxonomy/), [French (France)](https://fr.wordpress.org/plugins/related-posts-by-taxonomy/)
   og [Greek](https://el.wordpress.org/plugins/related-posts-by-taxonomy/).
 *  [Oversett til ditt språk](https://translate.wordpress.org/projects/wp-plugins/related-posts-by-taxonomy)
 * Stikkord
 * [posts](https://nb.wordpress.org/plugins/tags/posts/)[related](https://nb.wordpress.org/plugins/tags/related/)
   [related posts](https://nb.wordpress.org/plugins/tags/related-posts/)[taxonomy](https://nb.wordpress.org/plugins/tags/taxonomy/)
   [thumbnails](https://nb.wordpress.org/plugins/tags/thumbnails/)
 *  [Avansert visning](https://nb.wordpress.org/plugins/related-posts-by-taxonomy/advanced/)

## Vurderinger

 4.8 av 5 stjerner.

 *  [  70 5-star reviews     ](https://wordpress.org/support/plugin/related-posts-by-taxonomy/reviews/?filter=5)
 *  [  4 4-star reviews     ](https://wordpress.org/support/plugin/related-posts-by-taxonomy/reviews/?filter=4)
 *  [  2 3-star reviews     ](https://wordpress.org/support/plugin/related-posts-by-taxonomy/reviews/?filter=3)
 *  [  0 2-star reviews     ](https://wordpress.org/support/plugin/related-posts-by-taxonomy/reviews/?filter=2)
 *  [  1 1-star review     ](https://wordpress.org/support/plugin/related-posts-by-taxonomy/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/related-posts-by-taxonomy/reviews/#new-post)

[Se alle omtalene](https://wordpress.org/support/plugin/related-posts-by-taxonomy/reviews/)

## Bidragsytere

 *   [ keesiemeijer ](https://profiles.wordpress.org/keesiemeijer/)

## Brukerstøtte

Saker løst siste to måneder:

     1 av 1

 [Vis brukerstøtteforumet](https://wordpress.org/support/plugin/related-posts-by-taxonomy/)