PHPackages                             mrnebbi/craft-query-strings - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. mrnebbi/craft-query-strings

ActiveCraft-plugin

mrnebbi/craft-query-strings
===========================

Add your query strings back into your Craft CMS pagination. Pull an array of all query strings, including duplicate keys

1.0.7(7y ago)711[3 issues](https://github.com/mrnebbi/craft-query-strings/issues)PHP

Since Sep 14Pushed 7y ago2 watchersCompare

[ Source](https://github.com/mrnebbi/craft-query-strings)[ Packagist](https://packagist.org/packages/mrnebbi/craft-query-strings)[ RSS](/packages/mrnebbi-craft-query-strings/feed)WikiDiscussions master Synced 4d ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

[![Craft Query Strings](banner.png)](banner.png)

A Craft CMS plugin to provide twig filters and functions to help with query string management. This is especially helpful for adding query strings back to pagination.

[![version 1.0.7](https://camo.githubusercontent.com/9f2a07103afc5b9f36048b6a829b4c269b0fe6b6495327327c9e37423280ee47/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d312e302e372d627269676874677265656e2e737667)](https://github.com/mrnebbi/craft-query-strings)

preserveQueryStrings
--------------------

[](#preservequerystrings)

The Preserve Query String filter allows you to add `|preserveQueryStrings` to any URL output in twig, and it will keep the query strings as they should appear in the URL.

E.g.

```
{% if pageInfo.prevUrl %}Previous Page{% endif %}
{% if pageInfo.nextUrl %}Next Page{% endif %}
```

getQueryStrings
---------------

[](#getquerystrings)

Pull an array of query strings from Craft. This gets around the problem of duplicated query string keys being lost, turning them into an array you can loop through.

An array will be returned with objects. Use `.key` and `.value`.

### Return all URL queries

[](#return-all-url-queries)

```
{% for query in getQueryStrings() %}
  {{ query.key }} - {{ query.value }}
{% endfor %}
```

### Return only URL queries that match a key

[](#return-only-url-queries-that-match-a-key)

```
{% for query in getQueryStrings('lookForKey') %}
  {{ query.key }} - {{ query.value }}
{% endfor %}
```

getQueryFormFields
------------------

[](#getqueryformfields)

Sometimes you want to use query fields in a form, to preserve these values you can use the following in your templates.

```
{{ getQueryFormFields() }}
```

which is shorthand/equivalent to:

```
{% for query in getQueryStrings() %}

{% endfor %}
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance11

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 90.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2801d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/708691?v=4)[Ian Nebbiolo](/maintainers/mrnebbi)[@mrnebbi](https://github.com/mrnebbi)

---

Top Contributors

[![mrnebbi](https://avatars.githubusercontent.com/u/708691?v=4)](https://github.com/mrnebbi "mrnebbi (19 commits)")[![billythekid](https://avatars.githubusercontent.com/u/330170?v=4)](https://github.com/billythekid "billythekid (2 commits)")

---

Tags

craft-plugincraftcmscraftcms-pluginquerystrings

### Embed Badge

![Health badge](/badges/mrnebbi-craft-query-strings/health.svg)

```
[![Health](https://phpackages.com/badges/mrnebbi-craft-query-strings/health.svg)](https://phpackages.com/packages/mrnebbi-craft-query-strings)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
