🎯 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 Players

Pro Feature

[anwpfl-stat-players] ranks players by one statistic: top scorers, most assists, best average rating, most clean sheets, or any stat you track yourself. The leader gets a large highlighted row and everyone else follows as a numbered list.

It’s the leaderboard box you put in a sidebar, on a competition page or under a match report.

A top scorers list - the leader in a large highlighted row with a big photo and 25 goals, then four more players, each with a photo, club logo, games played and goal count

Premium Feature

This shortcode requires the Football Leagues Premium plugin.

🚀 Basic usage

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

That’s the top 10 scorers of competition 12, with the leader highlighted. 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.

The easiest way to build one is Football Leagues > Shortcodes. Pick 🔸 Stat :: Players (Single Stat Value) from the dropdown and you get the form below with a live preview. Watch the name: 🔸 Stats :: Players, one letter away, is the full statistics table.

The shortcode builder with Stat :: Players (Single Stat Value) selected - Stat Value set to Goals, the Calculation dropdown below it, and the Query section starting with Competition ID and Include All Stages

Typed and built shortcodes show photos differently

The builder writes every field into the shortcode, including photos="1". A shortcode you type by hand gets the default instead, which is photos="0" – no photos. If a copied example looks different from the preview, add photos="1".

Stat Players or Stats Players?

Two shortcodes, similar names, different jobs. One number per player, ranked: this page. Many numbers per player in a table: Stats Players.

ShortcodeShowsUse it for
[anwpfl-stat-players]One statistic, ranked, with the leader highlighted“Top scorers”, “Most assists”, “Best rated” boxes
[anwpfl-stats-players]A paged table with a column per statisticA full statistics page for a competition or club
[anwpfl-stats-players-custom]A table with your own columns and filtersAn interactive stats table
[anwpfl-players]Scorers or assists onlyThe free version

Choosing the statistic

Built-in stats

statCounts
appearanceGames played – started or came on
startedGames in the starting line-up
minutesMinutes on the field
goalsGoals
goals_penaltyGoals from penalties
goals_ownOwn goals
assistsAssists
goals_concededGoals conceded
clean_sheetsGames where a goalkeeper conceded nothing and either played the whole match or was taken off after two-thirds of it. A keeper who came on isn’t credited.
cards_yYellow cards
cards_rRed cards, including second yellows
cards_allYellows, second yellows and reds added together

Yellow cards follow Settings & Tools > Settings > Configuration > General, Second yellow in player stats in the Statistics & Display group. With the default, Yellow + Yellow/Red card, a second yellow also counts as a yellow. Switch it to Yellow/Red card and a player sent off for two bookings gets no yellow for that match.

Your own stats

Any custom player column of type Simple, Calculated or Formula works too, referenced by its numeric ID from the Statistics Configurator. They’re listed in the builder’s Stat Value dropdown after the built-in ones, so you rarely need to look the ID up. Time and Composed columns aren’t supported, and neither is the ID of a Default column – use the slug from the table above instead.

  • Rating. If the column is the one set as your Player Rating Field, the value shows as a coloured rating badge. Use calculation="avg_game" – it averages only the games that have a rating, so unrated appearances don’t drag it down.
  • Colour scale. A column with Color BG turned on shows its value as a coloured pill.
  • Ratios and percentages. For a Calculated column using ratio or ratio (%), use an average. Both avg_game and avg_90 give the season-long ratio; sum adds up each game’s ratio, which isn’t a number anyone wants.

Totals, averages and bests

calculationValue per player
sum (default)The total across every game in scope
avg_gameTotal divided by games played
avg_90Total per 90 minutes played
maxThe best single game
minThe lowest single game

Set digits with an average. It defaults to 0, so 0.81 goals per game prints as 1. digits only affects avg_game and avg_90; for the other calculations a custom column uses its own Digits setting from the Statistics Configurator.

Averages need a minimum

A player who came on once and scored tops a goals-per-game list with 1.00, above a striker on 0.81 after 31 games. Add min_games, min_games_percent or min_minutes to every average and rating list.

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.
multistage01 includes every stage of a multistage competition. With 0, a multistage competition’s ID counts only the games of its first stage. Makes no difference on a single-stage competition.
season_id(empty)Season ID
league_id(empty)League ID
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.
include_ids / exclude_ids(empty)Comma-separated game IDs to count only, or to leave out

Only finished games count. Friendlies are left out when you don’t set competition_id – so a season-wide list skips them – but pointing competition_id at a friendly competition includes its games.

Which players count

ParameterDefaultDescription
club_id(empty)Only what players did for this club. A player who moved mid-season is ranked on their games for this club alone.
player_id(empty)One player only – handy for a single “25 goals” figure in an article
type(empty = all)g goalkeepers, d defenders, m midfielders, f forwards, or p for everyone except goalkeepers (the builder calls it “Players”). Uses the position on the player’s profile.
nationality(empty)Only players of this country. Checks the main nationality, not a second one. Pick it in the builder.
exclude_nationality(empty)Leave out players of this country
min_games(empty)Minimum games played
min_games_percent(empty)Minimum games as a percentage (0-100) of what the busiest player in the same scope played
min_minutes(empty)Minimum minutes played
hide_zero1Leave out players whose value is 0

Ranking

ParameterDefaultDescription
stat(required)See Choosing the statistic above
calculationsumsum, avg_game, avg_90, max or min
sortdescasc puts the lowest value first. With hide_zero on, that means the lowest value above 0 – set hide_zero="0" to include players on 0.
limit10How many players. 0 lists everyone.
soft_limit01 keeps going past the limit until every player level with the last place is in. Works with totals, averages, ratings and ascending lists. Averages, ratings and ascending lists need FL+ 0.18.4 or later.

Players on the same value get different position numbers, in no guaranteed order.

Display

ParameterDefaultDescription
first_em1Show the leader as a large highlighted row with a bigger photo and number
photos0 (builder: 1)Player photos
club_logo1Logo of every club the player appeared for in the selected games
show_position0Position under the name
show_flag0Nationality flags, second nationality included
games_played0Number of games played
minutes_played0Number of minutes played
links0Link player names to their profiles
player_name(empty)short or full uses the player’s short or full name where one is filled in
one_line0A compact row per player: flag before the name, logos on the same line, no position or minutes
digits0Decimal places for avg_game and avg_90
show_full0A Show full list button under the block. It opens a window that loads 20 players at a time.
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

Three colour attributes aren’t in the builder, so add them by hand: em_bg and em_color set the background and text colour of the highlighted leader, border_color the border. Use hex values, with or without the # – colour names like red don’t work. The Show full list button text can be changed in Settings & Tools > Settings > Content > Text & Labels.

Examples

Top scorers with photos

[anwpfl-stat-players stat="goals" competition_id="12" limit="5" photos="1" games_played="1" links="1"]

The list at the top of this page.

Best average rating

[anwpfl-stat-players stat="14" calculation="avg_game" digits="2" min_games="20" competition_id="12" limit="5"]

14 stands for the ID of your rating column. Players need 20 games to qualify.

A best average rating list of five players, each rating shown with two decimals on a coloured badge, the leader on 7.89

Goals per 90 minutes

[anwpfl-stat-players stat="goals" calculation="avg_90" digits="2" min_minutes="900" competition_id="12" limit="5"]

Only players with at least 900 minutes – ten full games – are ranked.

A compact assists list

[anwpfl-stat-players stat="assists" competition_id="12" limit="5" one_line="1" show_flag="1" first_em="0"]
A compact assists list of five equal rows, no highlighted leader - each row has a position number, a flag, the player name, a club logo and the assist count

Goalkeepers with the most clean sheets

[anwpfl-stat-players stat="clean_sheets" type="g" competition_id="12" limit="5"]

Keep tied players together

[anwpfl-stat-players stat="goals" competition_id="12" limit="4" soft_limit="1"]

If three players share fourth place on 16 goals, you get six rows instead of cutting two of them off.

A club’s top scorers

[anwpfl-stat-players stat="goals" competition_id="12" club_id="8" limit="3"]

Top scorers of the last 30 days, with a full list

[anwpfl-stat-players stat="goals" days_offset="-30" limit="5" show_full="1"]

No competition set, so every official game of the last 30 days counts and friendlies don’t. The button under the list opens everyone else.

The Show full list window - a long numbered list of the competition's scorers, each with a club logo and a goal count

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:

[anwpfl-stat-players stat="goals" competition_id="%competition_id%" limit="5"]

When multistage is left out, the layout sets it to 1 for you, so a multistage competition counts all its stages. A shortcode copied from the builder carries multistage="0", and a value you write is kept – delete it, or change it to 1. For a whole set of leaderboards in one go, the layout’s own Season Leaders block is the faster option.

Other ways to add it

  • Gutenberg blockStat::Players (Leaders). It draws the same list, but its defaults differ: all stages included, photos and position on, zeros shown, and the leader not highlighted.
  • Classic widgetFL+ Stat :: Players (Single Stat Value). Fewer options and no calculation choice. Pick the rating column and it shows the average with one decimal.

🆘 Troubleshooting

Nothing renders

The shortcode prints no message when it has nothing to show. Check, in order:

  1. stat is empty or wrong. A typo in a slug, the ID of a deleted column, or the ID of a Default, Time or Composed column all print nothing.
  2. No finished games match. Check the IDs and dates. A competition with no finished games yet has nothing to rank.
  3. The filters leave nobody. min_games set too high, or hide_zero on for a stat nobody has recorded.

A multistage competition only shows early-round players

multistage defaults to 0, which counts the first stage only. Add multistage="1".

Averages are whole numbers

Add digits="2". Without it averages are rounded to 0 decimal places.

The list hasn’t updated

Results are cached. Saving any game clears the cache, otherwise a list is kept for up to a week. That matters most for date-relative lists like days_offset="-7" on a site where no game has been saved for a few days – save a game to refresh them.

Notes

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

📚 Related