Use the post_link
filter hook:
add_filter( 'post_link', 'wpse_change_post_link', 99, 3 );
function wpse_change_post_link( $url, $post, $leavename = false ) {
// Can't fill these conditions since you didn't specify them...
if ( 'my_post_type' === $post->post_type ) {
$url=""; // Your new URL...
}
return $url;
}
Related Posts:
- How to add an admin notice upon post save/update
- Apply the_title() filter in post & page title, but not in menu title
- Update post counts (published, draft, unattached) in admin interface
- Passing current cookies in wp_remote_get to get Draft Post Preview
- Removing any and all inline styles from the_content()
- Removing filter dropdown in posts table (in this case Yoast SEO)
- Get old values for post before saving new ones
- How does filter the_posts work?
- Listen to Post action
- How to publish a post with empty title and empty content?
- How to add a “publish” link to the quick actions
- Manipulate post category after time
- WooCommerce – Create Products Programatically [closed]
- Why is wordpress removing some unicode characters (e.g. some emojis) when I save my post?
- how to display post content without post image?
- Exclude category on blog list page
- How to remove_filter that filters iframes in posts? [duplicate]
- which action to hook to in order to perform post-publish action
- Cannot access current post’s ID in custom plugin
- Set number of article per number of page
- Filter posts by author and category simultaneously
- How to change post status from publish to draft using hook in wordpress?
- Filter post before *editing*
- Filter/Remove HTML Elements on all posts and pages
- prevent showing posts of an specific category in admin posts section
- how “manage_posts_custom_column” action hook relate to “manage_${post_type}_columns” filter hook?
- Using radio button meta data from a custom meta box
- If specific user role then sticky post
- Getting post id from wp_insert_post_data function?
- the_posts filter been called multiple time
- Filter Posts By Tag
- Custom excerpt length filter doesn’t work
- How can i do something after head like adding a hook for after head but before post
- Only display posts after current date
- Amend wordpress password function
- Custom Post Templates
- How to store an extra (surrogate) ID when creating a post with wp_insert_post?
- Global $post not working in OOP function WordPress
- How can I remove posts of a certain category from homepage after a specified time period?
- How to generate numbers indistinguishable for the IDs of the posts
- Modify WP_Post before processing
- How to filter posts that belong to a specific category only if that is the only category
- How to retrieve the postID in a “image_send_to_editor” hook function?
- Filter Custom Post Type by Category with Ajax
- Ajax posts filter by date, comments, top views, top likes
- Define a wordpress constant through plugin functions?
- How to add Tags Filter in wordpress admin dashboard
- pre_get_posts query between 2 dates (date stored in custom post meta)
- Applying $posts_clauses filter to specific queries only
- how to remove dash (-) post status from post title on posts listing page wordpress
- Admin Posts Table Column Fitlering is not working for Custom Post Type
- Get latest posts from WordPress site without header, menu and sidebar
- Modify Image Source With The_Content Filter?
- How to get post bulk edit action trigger and get edited post ids?
- What is the filter or hook to add admin controls to posts on the front end?
- Change post order random through out the entire WordPress
- use wpml_post_language_details function other plugin based on $post->ID [closed]
- How to hide html tags on revision comparison pages?
- WordPress: Develop multiple posts with different data
- how to filter posts by category without page load (ajax) in wordpress?
- Remove status ‘archived’ from the default post and page view
- Dropdown Select Post Filter
- long-title posts do not want published
- How to add a block to a category page?
- Add view to admin menu to filter for specific criteria ( If post is child of specific Parent )
- How do i search post by jquery datepicker?
- Add id attribute to h1 element of wordpress post
- show only one category and filter by tag
- Prevent WordPress from putting around specific element
- filter buddypress users posts by user ‘xprofile’ custom fields
- Override wp_link_pages pagebreak with filter
- How to create frontend Post filter using meta query
- Update user meta when post published no working
- Printable Page with all Posts from Tag
- How to test if user is filtering post list in dashboard
- Hide Admin posts & pages in Dashboard
- Fixing the WP Post Object for Custom Route
- Is it possible to completely replace a post with an action/filter?
- Extracting a TLD from the content and assign to custom field
- How to get the postID inside ‘content_save_pre’? Other hook?
- Filter question list on substring of metavalue
- Add review box by function at top or bottom of content
- Export Posts with specific custom fields by sql
- Custom plugin to get related posts by category
- Get results from the main wp_query
- How to modify specific parts of a post content in WordPress
- Keep post format class with isotope filter
- Custom filter on all post page (admin backend)
- How to use in_category?
- the_content() not displaying the full post
- wp_query posts sorting doesn’t work
- Hide the contents for specific post
- Error 404 blog/page/2/
- Onclick open posts displayed in slider in a popup [closed]
- Add custom PHP (no-SQL) filter to WP_query
- How do I save JS classes being applied to the WP dashboard via custom plugin?
- Filters do not work when there are multiple (one works)
- How can I change the post order after filtering in WordPress?
- Modify upload directory to use post category slug in file path on multisite installation
- Add function to single blog post pages only