🎯 Need Help?

Get Premium Support

Priority assistance from the developer

⬆️ Upgrade

Unlock all features

More from ANWP

Sports Leagues Premium

Multi-sport league management with advanced statistics

Learn more →

AnWP SL Theme Kit

Starter themes & block patterns for Sports Leagues

Learn more →

Stat Clubs

Pro Feature

[anwpfl-stat-clubs] ranks clubs by one statistic: most goals, fewest conceded, most home wins, corners per game, or a team stat you track yourself. You get a short numbered list with club logos, five clubs by default.

Use it for “Best attack” and “Best defence” boxes on a competition page, or a sidebar next to the standings.

A list of five clubs ranked by expected goals per game - position number, club logo, club name, games played and a value with two decimals, Barcelona first on 2.22

Premium Feature

This shortcode requires the Football Leagues Premium plugin.

🚀 Basic usage

[anwpfl-stat-clubs stat="goals" competition_id="12"]

That’s the five highest-scoring clubs of competition 12. stat is the only required attribute. Leave it out, or give it a value that doesn’t match a stat, and the shortcode prints nothing at all.

To build one with a live preview, go to Football Leagues > Shortcodes and pick 🔸 Stat :: Clubs (Single Stat Value). Two neighbours in the dropdown have nearly the same name: 🔸 Stats :: Clubs is the club statistics table and 🔸 Stats :: Club is one club’s panel.

The shortcode builder with Stat :: Clubs (Single Stat Value) selected - Stat Value and Calculation at the top, then the Query section with Competition ID, Include All Stages set to Yes, Season ID and League ID

Stat Clubs or Stats Clubs?

One number, many clubs, ranked: this page. Many numbers, many clubs: Stats Clubs. Many numbers, one club: Stats Club.

ShortcodeShowsUse it for
[anwpfl-stat-clubs]One statistic, ranked, top 5“Best attack”, “Most clean sheets” boxes
[anwpfl-stats-clubs]A table with the columns you pickA club statistics page comparing many numbers
[anwpfl-stats-club]One club’s stats as a panelA club page
[anwpfl-stats-h2h]Two clubs side by sideA match preview

Moving attributes between them? The names differ. Stats Clubs uses side, date_after and date_before; Stat Clubs uses home_away, date_from and date_to. An attribute the shortcode doesn’t know is ignored without a warning.

Choosing the statistic

statCounts, per game
wins / draws / lossesThe result by the score. Penalty shootouts aren’t taken into account, so a game decided on penalties counts as a draw for both clubs.
goalsGoals scored
goals_concededGoals conceded
clean_sheetsGames where the opponent didn’t score
cards_y / cards_rYellow and red cards – see the setting below
cornersCorners won
possessionBall possession, in %. Use it with calculation="avg_game"; a total means nothing.
foulsFouls
offsidesOffsides
shotsShots
shots_on_goalShots on goal

Cards follow Settings & Tools > Settings > Configuration > General, Second yellow in club & referee stats in the Statistics & Display group. With the default, Red Card, a second yellow is counted in cards_r only. Yellow + Red Card counts it in both, and Yellow Card counts it in cards_y only.

Your own team stats. The Stat Value dropdown also lists the custom team statistics from the Statistics Configurator, after the built-in ones. Pick them in the builder; in the shortcode they appear as their numeric column ID.

Games without team stats count as 0. Corners, possession, fouls, offsides, shots and custom stats come from what’s entered in each game’s Match Stats box. A game where nothing was entered still counts as a game played, with a value of 0 – which pulls averages down and makes the lowest single game 0.

Totals, averages and highs

calculationValue per club
sum (default)The total across every game in scope
avg_gameTotal divided by games played
maxThe highest single game
minThe lowest single game

There’s no per-90 option for clubs. Set digits with avg_game – it defaults to 0, so 1.87 prints as 2. For the other calculations digits does nothing, and a custom stat uses its own Digits setting from the Statistics Configurator instead.

Parameters

Which games count

ParameterDefaultDescription
competition_id(empty)One or more competition IDs, comma-separated. The builder’s picker lists main stages only – type a stage’s ID by hand to rank a single stage.
multistage1Include every stage of a multistage competition. In the builder: Include All Stages (in Multistage competition), set to Yes. 0 counts only the games of the first stage. The builder field arrived in FL+ 0.18.4 – on older versions, type multistage="0" by hand.
season_id(empty)Season ID
league_id(empty)League ID
home_away(empty = both)h for home games only, a for away games only
matchweeks(empty)Comma-separated matchweek numbers, or round IDs in a knockout stage
stadium_id(empty)Games at one stadium
date_from / date_to(empty)YYYY-MM-DD. Both days are included.
days_offset(empty)Relative start date. -7 = from 7 days ago.
days_offset_to(empty)Relative end date, not included. 1 = up to the end of today.

Only finished, official games count. Friendlies never do, even when competition_id points at a friendly competition.

Ranking

ParameterDefaultDescription
stat(required)See Choosing the statistic above
calculationsumsum, avg_game, max or min
sortdescasc puts the lowest value first
limit5How many clubs. 0 lists them all.

Every club with a finished game in scope is ranked, including clubs on 0 – there’s no option to hide them. Clubs on the same value get different position numbers, in no guaranteed order.

Display

ParameterDefaultDescription
show_logo1Club logo, or the default logo when a club has none
links0Link club names to their club pages (builder: Link to Team)
team_title(empty)abbr shows the club abbreviation, or the full name when a club has none
show_games_played0Games played, as a small number beside the club name
digits0Decimal places for avg_game
show_full0A Show full list button under the block, opening a window that loads 10 clubs at a time. Not shown with limit="0", where every club is already listed.
custom_header(empty)Heading text above the list
custom_header_tagdivh2, h3, h4 or h5
max_width / min_width(empty)Block width limits in px
border_color(empty)Border colour as a hex value, with or without the #. Not in the builder.

The Show full list button text can be changed in Settings & Tools > Settings > Content > Text & Labels.

Examples

Expected goals per game

[anwpfl-stat-clubs stat="18" calculation="avg_game" digits="2" competition_id="12" show_games_played="1" links="1"]

18 stands for the ID of a custom Expected Goals column – pick yours from the Stat Value dropdown. This is the list at the top of the page.

Best home record

[anwpfl-stat-clubs stat="wins" home_away="h" competition_id="12" custom_header="Most home wins" custom_header_tag="h3"]
A Most home wins heading above five clubs ranked by home wins, each row with a position number, club logo, club name and win count, the leader on 19

Best defence

[anwpfl-stat-clubs stat="goals_conceded" sort="asc" competition_id="12"]

Corners per game

[anwpfl-stat-clubs stat="corners" calculation="avg_game" digits="1" competition_id="12"]

Most goals in a single game

[anwpfl-stat-clubs stat="goals" calculation="max" competition_id="12"]

In-form attacks, with a full list

[anwpfl-stat-clubs stat="goals" days_offset="-30" show_full="1"]

Goals from every official game of the last 30 days, top five, with a button to open the rest.

First stage only

[anwpfl-stat-clubs stat="goals" competition_id="12" multistage="0"]

On a multistage competition, this counts the games of the first stage and leaves out the later ones.

Using it in the Layout Builder

On a competition layout, put the shortcode in a Global Shortcode block and let the layout fill in the competition. All stages are already included by default.

[anwpfl-stat-clubs stat="clean_sheets" competition_id="%competition_id%"]

Other ways to add it

The Gutenberg block Stat::Clubs draws the same list with the same options. The one default that differs is limit: the block shows 10 clubs, the shortcode 5. There’s no classic widget for clubs.

🆘 Troubleshooting

Nothing renders

The shortcode prints no message when it has nothing to show. Check that stat is set and spelled correctly, then that the competition, season or dates you gave cover at least one finished official game. A competition made up of friendlies shows nothing, because friendlies never count.

Averages look too low, or the lowest game is 0

Some games have no team stats entered. They count as 0 and still count as games. Fill in the Match Stats box on those games, or narrow the list with dates or matchweeks to the games that have data.

Card numbers don’t match another page

Check Second yellow in club & referee stats (see Choosing the statistic above). Player lists use a separate setting, Second yellow in player stats, so a club’s red cards here can differ from its players’ red cards added up.

The list hasn’t updated

Results are cached for up to an hour. Saving any game clears the cache straight away.

Notes

When competition_id holds several competitions, the Show full list window currently counts only the first one.

📚 Related