Skip to content

Repeater Control Type

Repeater control type let you create repeatable groups of attributes. This is perfect for blocks that need multiple instances of the same content structure, like testimonials, team members, or FAQ sections.

A repeater control type contains multiple instances of the same set of attributes. Each instance (item) can have its own values.

Example: A testimonial block with a repeater for multiple testimonials:

  • Each testimonial has: quote, author, avatar
  • User can add/remove/reorder testimonials
  1. In block editor, click + Add Attribute
  2. Set Name: testimonials
  3. Set Type: Repeater
  4. Set Label: Testimonials
  1. In the repeater settings, add sub-fields:
    • quote — Textarea
    • author — Text
    • avatar — Image
  2. Set constraints:
    • Min items: 1
    • Max items: 10

Update your template to loop through items:

<div class="testimonials">
{% for testimonial in attributes.testimonials %}
<div class="testimonial">
<blockquote>{{ testimonial.quote }}</blockquote>
<div class="author">
<img src="{{ testimonial.avatar }}" alt="{{ testimonial.author }}">
<span>{{ testimonial.author }}</span>
</div>
</div>
{% endfor %}
</div>
SettingDescription
Min itemsLowest number of items (0 for optional)
Max itemsHighest number of items allowed
CollapsibleAllow users to collapse/expand items
Label templateCustom label for each item
<div class="faq-block">
{% for item in attributes.faqs %}
<div class="faq-item">
<h3>{{ item.question }}</h3>
<p>{{ item.answer }}</p>
</div>
{% endfor %}
</div>
<?php if (!empty($attributes['testimonials'])) : ?>
<div class="testimonials">
<?php foreach ($attributes['testimonials'] as $item) : ?>
<div class="testimonial">
<blockquote><?php echo esc_html($item['quote']); ?></blockquote>
<div class="author">
<?php if (!empty($item['avatar'])) : ?>
<img src="<?php echo esc_url($item['avatar']); ?>" alt="">
<?php endif; ?>
<span><?php echo esc_html($item['author']); ?></span>
</div>
</div>
<?php endforeach; ?>
</div>
<?php endif; ?>
  1. Set reasonable limits — Don’t allow unlimited items
  2. Use clear sub-field names — Makes template writing easier
  3. Consider performance — Too many items can slow the editor
  4. Group logically — Keep related fields together