WordPress filter hook · part of WordPress core
the_permalink
A WordPress core filter that 70 plugins also fire themselves, running on 4.2M+ sites between them.
“This filter is documented in wp-includes/link-template.php”
How to use the_permalink
It's a filter: your callback receives the value, and must return the (changed) value.
Add this to your theme's functions.php or a small custom plugin:
add_filter( 'the_permalink', function( $permalink ) {
// Change $permalink here.
return $permalink;
}, 10, 1 );Argument names come from WP Bootstrap Carousel's source. Other plugins may pass different values: check the call in the plugin you're targeting below.
This hook is fired by WordPress core too. Official reference on developer.wordpress.org →
70 plugins that fire the_permalink
Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.
-
Jetpack3+ million installs
apply_filters( 'the_permalink', get_permalink() )modules/carousel/jetpack-carousel.php:500 -
GTM4WP700,000+ installs
apply_filters( 'the_permalink', $product instanceof \WC_Product ? $product->get_permalink() : '', 0 )src/Modules/WooCommerce/ListTracking.php:198 -
The Plus Addons for Elementor100,000+ installs
apply_filters( 'the_permalink', get_permalink() )modules/widgets/tp_post_comment.php:1482 -
Customer Reviews for WooCommerce80,000+ installs
apply_filters( 'the_permalink', get_the_permalink(), $cr_item_id )templates/cr-review-form.php:66 -
Display Posts70,000+ installs
apply_filters( 'the_permalink', get_permalink() )display-posts-shortcode.php:497 -
Brizy60,000+ installs
apply_filters( 'the_permalink', get_permalink($p_id), $this->getWpPost() )editor/post.php:224 -
Master Addons for Elementor30,000+ installs
apply_filters( 'the_permalink', get_permalink($post_id), $post_id )addons/content/ma-comments/ma-comments.php:2280 -
Directorist: AI-Powered Business Directory, Listings & Classified Ads20,000+ installs
apply_filters( 'the_permalink', get_permalink( $post_id ), $post_id )includes/review/class-comment-form-renderer.php:320 -
Animation Addons for Elementor10,000+ installs
apply_filters( 'the_permalink', get_permalink( $aaeaddon_post_id ) )templates/comments.php:203 -
Business Directory Plugin10,000+ installs
apply_filters( 'the_permalink', get_permalink() )includes/abstracts/class-view.php:136 -
Catch Gallery10,000+ installs
apply_filters( 'the_permalink', get_permalink() )inc/jetpack-carousel.php:135 -
Related Posts by Taxonomy10,000+ installs
apply_filters( 'the_permalink', get_permalink( $post ), $post )includes/template-tags.php:227 -
Nexter Blocks9,000+ installs
apply_filters( 'the_permalink', get_permalink() )classes/blocks/tp-post-comment/index.php:102 -
FeedWordPress8,000+ installs
apply_filters( 'the_permalink', get_local_permalink( $id ) )template-functions.php:165 -
Gmedia Photo Gallery7,000+ installs
apply_filters( 'the_permalink', get_permalink( $postid ) )template/comments.php:44 -
ProfileGrid5,000+ installs
apply_filters( 'the_permalink', get_permalink( $post_id ), $post_id )public/class-profile-magic-public.php:6725 -
LocalWeb All In One5,000+ installs
apply_filters( 'the_permalink', get_permalink(), 0 )public/partials/lw-all-in-one-public-woocommerce-gtm.php:616 -
Gallery Carousel Without JetPack4,000+ installs
apply_filters( 'the_permalink', get_permalink() )carousel/jetpack-carousel.php:146 -
Hierarchical HTML Sitemap4,000+ installs
apply_filters( 'the_permalink', get_permalink( $page ), $page )hierarchical-sitemap.php:262 -
WPMobile.App3,000+ installs
apply_filters( 'the_permalink', get_permalink() )themes/wpappninja/comments.php:100 -
Post Content Shortcodes2,000+ installs
apply_filters( 'the_permalink', get_permalink( $p->ID ) )classes/class-post-content-shortcodes.php:854 -
RS Template Builder For Elementor2,000+ installs
apply_filters( 'the_permalink', get_permalink() )includes/elementor/widgets/class-post-excerpt.php:376 -
XML Sitemaps1,000+ installs
apply_filters( 'the_permalink', get_permalink( $this->blog_page_id ) )xml-sitemaps-utils.php:188 -
Reviews Plus1,000+ installs
apply_filters( 'the_permalink', get_permalink( get_the_ID() ) )includes/includes.php:55 -
MDTF900+ installs
apply_filters( 'the_permalink', get_permalink($wp_query->queried_object->ID) )views/shortcode/do_mdf_search_form.php:897 -
Custom CSS900+ installs
apply_filters( 'the_permalink', $this->_getWPLayer()->get_permalink( $post_id ) )fresh-framework/framework/themes/functions/class.ffCommentsFormPrinter.php:165 -
xili-language600+ installs
apply_filters( 'the_permalink', get_permalink( $post->ID ) )xili-language.php:2734 -
Webcomic600+ installs
apply_filters( 'the_permalink', get_permalink( $args['post_parent']->ID ) )lib/transcribe/globals.php:222 -
Essential Classy Addons for Elementor400+ installs
apply_filters( 'the_permalink', get_permalink() )element/widgets/ecafe-post-comment.php:1755 -
Robots & Sitemap400+ installs
apply_filters( 'the_permalink', $this->url, $this->post )core/db/post/class-sitemap-post-item.php:133 -
Mihdan: Ajax Edit Comments300+ installs
apply_filters( 'the_permalink', get_permalink( $oldPostID ) )lib/class.ajax.php:704 -
WP Bootstrap Carousel100+ installs
apply_filters( 'the_permalink', get_permalink( $post_id ) )inc/wp-bootstrap-carousel-dps.php:248 -
Funtionalities for Alpus theme100+ installs
apply_filters( 'the_permalink', get_permalink() )framework/addons/share/class-alpus-share.php:148 -
Schema Breadcrumbs100+ installs
apply_filters( 'the_permalink', $link )schema-breadcrumbs.php:889 -
Bookmark Me90+ installs
apply_filters( 'the_permalink', get_permalink() )sem-bookmark-me.php:242 -
WP Custom Author Image90+ installs
apply_filters( 'the_permalink', get_permalink($post_id) )wp-custom-author-image.php:324 -
Simple Hierarchical Sitemap80+ installs
apply_filters( 'the_permalink', get_permalink($id) )inc/class.shortcode.php:27 -
Super Related Posts50+ installs
apply_filters( 'the_permalink', get_permalink($result->ID) )includes/output_tags.php:35 -
ShareMe40+ installs
apply_filters( 'the_permalink', get_permalink() )class.shareMe.php:189 -
Custom Sidebars Manager20+ installs
apply_filters( 'the_permalink', $this->_getWPLayer()->get_permalink( $post_id ) )fresh-framework/framework/themes/functions/class.ffCommentsFormPrinter.php:165 -
Posts Per Page Customizer20+ installs
apply_filters( 'the_permalink', $this->_getWPLayer()->get_permalink( $post_id ) )fresh-framework/framework/themes/functions/class.ffCommentsFormPrinter.php:165 -
Comments Everywhere10+ installs
apply_filters( 'the_permalink', get_permalink( $post_id ) )files/comment-template.php:30 -
Social Bookmark10+ installs
apply_filters( 'the_permalink', get_permalink() )social-bookmark-dyc.php:237 -
SB Comment10+ installs
apply_filters( 'the_permalink', get_permalink() )inc/sb-plugin-functions.php:35 -
WP Forum10+ installs
apply_filters( 'the_permalink', get_permalink() )view/shortcode/wp-forum-inner.php:29 -
GDPress10+ installs
apply_filters( 'the_permalink', get_permalink( $post_id ), $post_id )gp-includes/class/GDP_Request.class.php:85 -
Category class10+ installs
apply_filters( 'the_permalink', get_permalink($this->ID) )inc/squelette.class.php:21 -
Give Me Answer Lite10+ installs
apply_filters( 'the_permalink', get_permalink( $post_id ) )includes/class-template.php:288 -
FV Community News10+ installs
apply_filters( 'the_permalink', get_permalink(home_url('/')) )fvcn-theme/fvcn/form-post.php:63 -
NutritionWP10+ installs
apply_filters( 'the_permalink', $this->get_permalink() )includes/class-nwp-post.php:141 -
News List ShortCode10+ installs
apply_filters( 'the_permalink', get_permalink() )news-list-shortcode.php:162 -
RP News Ticker10+ installs
apply_filters( 'the_permalink', get_permalink() )rp-news-ticker-front.php:84 -
Nuconomy Insights10+ installs
apply_filters( 'the_permalink', get_permalink($p->ID) )nuconomy.php:1096 -
Plugin Name: GMO Share Connection10+ installs
apply_filters( 'the_permalink', get_permalink() )gmo-share-connection.php:470 -
LH Posse10+ installs
apply_filters( 'the_permalink', get_permalink() )lh-posse.php:67 -
WP Horizontal Slider10+ installs
apply_filters( 'the_permalink', get_permalink() )wp-horizontal-slider.php:53 -
Social Hub10+ installs
apply_filters( 'the_permalink', get_permalink() )class-share-buttons.php:104 -
Image Annotations10+ installs
apply_filters( 'the_permalink', get_permalink(get_the_ID()) )image-annotations.php:420 -
ENL Newsletter10+ installs
apply_filters( 'the_permalink', get_permalink() )include/tools.php:36 -
Plugin Name: Highlight Post Widget10+ installs
apply_filters( 'the_permalink', get_permalink() )highlight-post.php:51 -
Business Listing PluginFewer than 10 installs
apply_filters( 'the_permalink', get_permalink() )includes/bizlisting-shortcode.php:416 -
CommentAuraFewer than 10 installs
apply_filters( 'the_permalink', get_permalink((int) $data['post_id']), (int) $data['post_id'] )views/thread/comment-form-shell.php:79 -
WP RESTful Users PluginFewer than 10 installs
apply_filters( 'the_permalink', get_permalink( $post_id ) )wp-restful-users.php:163 -
Zhu Posts Icon Carousel for WordPressFewer than 10 installs
apply_filters( 'the_permalink', get_permalink() )lib/class-zhu-pic-1-widget.php:165 -
OnListFewer than 10 installs
apply_filters( 'the_permalink', get_permalink() )inc/templates/comments.php:62 -
RecommenderFewer than 10 installs
apply_filters( 'the_permalink', get_permalink($post->ID) )classes/DisplayPostsShortcode.php:356 -
LH Native CommentsFewer than 10 installs
apply_filters( 'the_permalink', get_permalink( ) )lh-native-comments.php:468 -
WP AJAX Comments TemplateFewer than 10 installs
apply_filters( 'the_permalink', get_permalink( ) )comments.php:94 -
Recent Posts Multi-sitewideFewer than 10 installs
apply_filters( 'the_permalink', get_permalink( $post->ID) )recent_mu_posts.php:75 -
Plugin Name: WP Submit HelperFewer than 10 installs
apply_filters( 'the_permalink', get_permalink() )wp-submit-helper.php:60
Need a customisation built on this hook?
Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.