Title: Publicize custom content
Last modified: August 31, 2016

---

# Publicize custom content

 *  [nsoltan](https://wordpress.org/support/users/nsoltan/)
 * (@nsoltan)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/publicize-custom-content/)
 * Hi! I’m attempting to get Publicize to post a message containing post title +
   link + hashtags, that is shorter for twitter (title+link) and longer for facebook(
   gives a lot more space for a message).
 * I found some older posts suggesting [https://wordpress.org/plugins/publicize-with-hashtags/](https://wordpress.org/plugins/publicize-with-hashtags/)
   as well as a custom function on [https://github.com/Automattic/jetpack/issues/261](https://github.com/Automattic/jetpack/issues/261)
 * However, I’ve gotten stuck on trying to get the plugin and/or function to hook
   when a post is being submitted via XMLRPC. It just doesn’t :/
 * Do you have any suggestions on how I could proceed?
 * [https://wordpress.org/plugins/jetpack/](https://wordpress.org/plugins/jetpack/)

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

 *  Plugin Author [Jeremy Herve](https://wordpress.org/support/users/jeherve/)
 * (@jeherve)
 * Jetpack Mechanic 🚀
 * [10 years, 7 months ago](https://wordpress.org/support/topic/publicize-custom-content/#post-6903800)
 * The plugin you mentioned gets triggered with the `save_post` hook. That action
   is triggered whenever a post or page is created or updated, which could be from
   an import, post/page edit form, xmlrpc, or post by email.
 * If it doesn’t work in your case, I would suggest trying with a different XML-
   RPC client, to make sure the problem isn’t linked to your current client.
 * Let me know how it goes.
 *  Thread Starter [nsoltan](https://wordpress.org/support/users/nsoltan/)
 * (@nsoltan)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/publicize-custom-content/#post-6903806)
 * Hi Jeremy! Do you mean the plugin you wrote? Currently neither that or the linked
   plugin are working while using the WordPress mobile app or importing posts through
   the python wp-library 🙁
 *  Plugin Author [Jeremy Herve](https://wordpress.org/support/users/jeherve/)
 * (@jeherve)
 * Jetpack Mechanic 🚀
 * [10 years, 7 months ago](https://wordpress.org/support/topic/publicize-custom-content/#post-6903836)
 * The function might not work when importing posts since imports work a bit differently,
   and Publicize was built to ignore imported posts.
 * It should however work with the mobile apps. When using the code snippet I published,
   could you try to save a new post as a draft in the app, and then publish it? 
   Does it help?
 *  Thread Starter [nsoltan](https://wordpress.org/support/users/nsoltan/)
 * (@nsoltan)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/publicize-custom-content/#post-6903858)
 * Hi again! Using the online interface I see the # when creating a post. Publicize
   is publishing the post with the normal template just fine when posting via python
   and mobile, but no #.
 *  Plugin Author [Jeremy Herve](https://wordpress.org/support/users/jeherve/)
 * (@jeherve)
 * Jetpack Mechanic 🚀
 * [10 years, 7 months ago](https://wordpress.org/support/topic/publicize-custom-content/#post-6903874)
 * Could you paste the snippet you used here, so I can run some tests on my end?
 * Thanks!
 *  Thread Starter [nsoltan](https://wordpress.org/support/users/nsoltan/)
 * (@nsoltan)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/publicize-custom-content/#post-6903893)
 *     ```
       function jeherve_publicize_hashtags() {
       	$post = get_post();
       	if ( ! empty( $post ) ) {
   
       		// Grab the tags of the post
       		$post_tags = get_the_tags( $post->ID );
   
       		// Append tags to custom message
       		if ( ! empty( $post_tags ) ) {
   
       			// Create list of tags with hashtags in front of them
       			$hash_tags = '';
       			foreach( $post_tags as $tag ) {
       				$hash_tags .= ' #' . $tag->name;
       			}
   
       			// Create our custom message
       			$custom_message = get_the_title() . ' ' . $hash_tags;
       			update_post_meta( $post->ID, '_wpas_mess', $custom_message );
       		}
       	}
       }
   
       // Save that message
       function jeherve_cust_pub_message_save() {
       	add_action( 'save_post', 'jeherve_publicize_hashtags' );
       }
       add_action( 'publish_post', 'jeherve_cust_pub_message_save' );
       ```
   
 *  Plugin Author [Jeremy Herve](https://wordpress.org/support/users/jeherve/)
 * (@jeherve)
 * Jetpack Mechanic 🚀
 * [10 years, 7 months ago](https://wordpress.org/support/topic/publicize-custom-content/#post-6903899)
 * Could you let me know where you pasted that snippet? In a functionality plugin
   like [this one](https://wordpress.org/plugins/code-snippets/)?
 *  Thread Starter [nsoltan](https://wordpress.org/support/users/nsoltan/)
 * (@nsoltan)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/publicize-custom-content/#post-6903901)
 * Hi again!
 * I used “Functionality”-plugin, I switched to the one you suggested, still the
   same (lack-of) effect 🙁
 *  Plugin Author [Jeremy Herve](https://wordpress.org/support/users/jeherve/)
 * (@jeherve)
 * Jetpack Mechanic 🚀
 * [10 years, 7 months ago](https://wordpress.org/support/topic/publicize-custom-content/#post-6903903)
 * Thanks for sticking with me on this. I looked into this a bit more, and I’m afraid
   that’s an issue with how Jetpack synchronizes its data, as outlined here:
    [https://github.com/Automattic/jetpack/issues/3267](https://github.com/Automattic/jetpack/issues/3267)
 * We’ll work on getting this fixed as it sometimes causes other issues when trying
   to customize Related Posts, but until that issue is closed I’m afraid I won’t
   have a way to work around this problem.
 * Sorry not to be of more help.
 *  Thread Starter [nsoltan](https://wordpress.org/support/users/nsoltan/)
 * (@nsoltan)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/publicize-custom-content/#post-6903913)
 * Thank you for trying!

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

The topic ‘Publicize custom content’ is closed to new replies.

 * ![](https://ps.w.org/jetpack/assets/icon.svg?rev=2819237)
 * [Jetpack - WP Security, Backup, Speed, & Growth](https://wordpress.org/plugins/jetpack/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/jetpack/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/jetpack/)
 * [Active Topics](https://wordpress.org/support/plugin/jetpack/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/jetpack/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/jetpack/reviews/)

## Tags

 * [hashtags](https://wordpress.org/support/topic-tag/hashtags/)
 * [publicize](https://wordpress.org/support/topic-tag/publicize/)
 * [xmlrpc](https://wordpress.org/support/topic-tag/xmlrpc/)

 * 10 replies
 * 2 participants
 * Last reply from: [nsoltan](https://wordpress.org/support/users/nsoltan/)
 * Last activity: [10 years, 6 months ago](https://wordpress.org/support/topic/publicize-custom-content/#post-6903913)
 * Status: not resolved