Title: Procedurally Replace Table H2 Generated IDs
Last modified: January 15, 2025

---

# Procedurally Replace Table H2 Generated IDs

 *  Resolved [h3atmiser](https://wordpress.org/support/users/h3atmiser/)
 * (@h3atmiser)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/procedurally-replace-table-h2-generated-ids/)
 * Hello,
 * I’m looking for a way to procedurally replace (preferably in functions.php) the
   auto-generated IDs for the h2 heading elements that precede all of the tables.
   Our website uses a lot of page jump links and I would prefer having the value
   stored in the h2 element be the ID instead of the “tablepress-###-name” one for
   ease of access reasons.
 * Thank you!

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/procedurally-replace-table-h2-generated-ids/#post-18245475)
 * Hi!
 * Thanks for your post and sorry for the trouble!
 * The DOM attributes of the table name heading are run through a filter hook, so
   that you could use that to modify them. Here is the filter hook definition: [https://github.com/TablePress/TablePress/blob/3.0.2/classes/class-render.php#L409-L418](https://github.com/TablePress/TablePress/blob/3.0.2/classes/class-render.php#L409-L418)
 * The `$name_attributes['id']` value is the ID that you would need to adjust in
   a filter hook callback here.
 * Best wishes,
   Tobias
 *  Thread Starter [h3atmiser](https://wordpress.org/support/users/h3atmiser/)
 * (@h3atmiser)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/procedurally-replace-table-h2-generated-ids/#post-18245501)
 * This is exactly what I needed, thank you!
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/procedurally-replace-table-h2-generated-ids/#post-18245518)
 * Hi [@h3atmiser](https://wordpress.org/support/users/h3atmiser/),
 * no problem, you are very welcome! 🙂 Good to hear that this helped!
 * Best wishes,
   Tobias
 * P.S.: In case you haven’t, please [rate TablePress in the plugin directory](https://wordpress.org/support/plugin/tablepress/reviews/#new-post).
   Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Procedurally Replace Table H2 Generated IDs’ is closed to new replies.

 * ![](https://ps.w.org/tablepress/assets/icon.svg?rev=3192944)
 * [TablePress - Tables in WordPress made easy](https://wordpress.org/plugins/tablepress/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/tablepress/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/tablepress/)
 * [Active Topics](https://wordpress.org/support/plugin/tablepress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/tablepress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/tablepress/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * Last activity: [1 year, 4 months ago](https://wordpress.org/support/topic/procedurally-replace-table-h2-generated-ids/#post-18245518)
 * Status: resolved